-
Notifications
You must be signed in to change notification settings - Fork 990
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
[core] Introduce timeout for commit retry avoid long time loop #4668
Conversation
@@ -134,6 +135,7 @@ public class FileStoreCommitImpl implements FileStoreCommit { | |||
private final List<CommitCallback> commitCallbacks; | |||
private final StatsFileHandler statsFileHandler; | |||
private final BucketMode bucketMode; | |||
private final Optional<Duration> commitMaxTimeout; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not use optional for class member, you can use nullable field here.
@@ -1066,6 +1082,16 @@ public void compactManifest() { | |||
commitMaxRetries)); | |||
} | |||
retryCount++; | |||
|
|||
if (commitMaxTimeout.isPresent() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please merge into if (retryCount >= commitMaxRetries)
.
@@ -754,6 +759,16 @@ private int tryCommit( | |||
commitMaxRetries)); | |||
} | |||
retryCount++; | |||
|
|||
if (commitMaxTimeout.isPresent() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please merge into if (retryCount >= commitMaxRetries).
@@ -134,6 +134,12 @@ | |||
<td>Integer</td> | |||
<td>Maximum number of retries when commit failed.</td> | |||
</tr> | |||
<tr> | |||
<td><h5>commit.max-timeout</h5></td> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
max timeout seems weird... it is just timeout?
commit.timeout
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sense,changed to commit.timeout,Thanks~ @JingsongLi
@@ -166,7 +168,8 @@ public FileStoreCommitImpl( | |||
BucketMode bucketMode, | |||
@Nullable Integer manifestReadParallelism, | |||
List<CommitCallback> commitCallbacks, | |||
int commitMaxRetries) { | |||
int commitMaxRetries, | |||
@Nullable Duration commitMaxTimeout) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you modify all MaxTimeout to Timeout?
@@ -134,6 +135,7 @@ public class FileStoreCommitImpl implements FileStoreCommit { | |||
private final List<CommitCallback> commitCallbacks; | |||
private final StatsFileHandler statsFileHandler; | |||
private final BucketMode bucketMode; | |||
@Nullable private Duration commitMaxTimeout; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
store millis here.
@@ -134,6 +134,7 @@ public class FileStoreCommitImpl implements FileStoreCommit { | |||
private final List<CommitCallback> commitCallbacks; | |||
private final StatsFileHandler statsFileHandler; | |||
private final BucketMode bucketMode; | |||
@Nullable private long commitTimeout; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove @nullable
@@ -166,7 +167,8 @@ public FileStoreCommitImpl( | |||
BucketMode bucketMode, | |||
@Nullable Integer manifestReadParallelism, | |||
List<CommitCallback> commitCallbacks, | |||
int commitMaxRetries) { | |||
int commitMaxRetries, | |||
@Nullable long commitTimeout) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove @nullable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Thanks for reminder @JingsongLi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Purpose
Linked issue: close #xxx
Tests
API and Format
Documentation