Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

curvefs/client: limited download retry times #2130

Closed
wants to merge 0 commits into from
Closed

curvefs/client: limited download retry times #2130

wants to merge 0 commits into from

Conversation

CodeFarmerPK
Copy link
Contributor

Signed-off-by: CodeFarmerPK CodeFarmer.PK@Gmail.com

What problem does this PR solve?

Issue Number: #xxx

Problem Summary:

What is changed and how it works?

What's Changed:

How it Works:

Side effects(Breaking backward compatibility? Performance regression?):

Check List

  • Relevant documentation/comments is changed or added
  • I acknowledge that all my contributions will be made under the project's license

@CodeFarmerPK
Copy link
Contributor Author

recheck

1 similar comment
@CodeFarmerPK
Copy link
Contributor Author

recheck

@@ -34,6 +34,8 @@
#include "curvefs/src/client/s3/client_s3_cache_manager.h"
#include "src/common/s3_adapter.h"

const int MAX_RETRY_TIME = 3;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's better to read the max retry time from conf file

@@ -277,7 +277,18 @@ void FuseS3Client::WarmUpAllObjs(
delete []context->buf;
return;
}
// todo: retry
if (context->retry >= MAX_RETRY_TIME) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

context->retry not initialized

LOG(WARNING) << "Up to max retry times";
}
delete []context->buf;
return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WarmUpAllObjs may be failed, should add return status at WarmUpAllObjs

It is necessary to judge the return value of WarmUpAllObjs at the place where WarmUpAllObjs is called

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WarmUpAllObjs may be failed, should add return status at WarmUpAllObjs

It is necessary to judge the return value of WarmUpAllObjs at the place where WarmUpAllObjs is called

there is no need to do that, because Warm-up is just a matter of downloading as much as possible, not a necessity

@wuhongsong
Copy link
Contributor

recheck

3 similar comments
@wuhongsong
Copy link
Contributor

recheck

@wuhongsong
Copy link
Contributor

recheck

@CodeFarmerPK
Copy link
Contributor Author

recheck

@@ -121,6 +123,7 @@ class FuseS3Client : public FuseClient {
Thread bgFetchThread_;
std::atomic<bool> bgFetchStop_;
std::mutex fetchMtx_;
uint32_t downloadMaxRetryTimes;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

downloadMaxRetryTimes_ is better.

delete []context->buf;
return;
}
context->retry++;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe
if ( ++context->retry >= downloadMaxRetryTimes) { is better

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I accept this suggistion, but i still think the original type is much easier to understand

VLOG(6) << "pendingReq is over";
cond.Signal();
} else {
LOG(WARNING) << "Up to max retry times";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need else? because we always need this output. and please add the objname that is download failed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants