Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/overlaybd/registryfs/registryfs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -459,15 +459,15 @@ class RegistryFileImpl : public photon::fs::VirtualReadOnlyFile {
*/
int64_t getMetaLength(uint64_t timeout = -1) {
photon::net::HeaderMap headers;
Timeout tmo(timeout);
int retry = 3;
again:
Timeout tmo(timeout);
auto code = m_fs->GET(m_url.c_str(), &headers, -1, -1, nullptr, tmo.timeout());
if (code != 200 && code != 206) {
if (tmo.expire() < photon::now)
LOG_ERROR_RETURN(ETIMEDOUT, -1, "Get meta timedout");
if (retry--)
goto again;
if (tmo.expire() < photon::now)
LOG_ERROR_RETURN(ETIMEDOUT, -1, "Get meta timedout");
if (code == 401 || code == 403) {
LOG_ERROR_RETURN(EPERM, -1, "Authorization failed");
} else if (code == 404) {
Expand Down
Loading