-
Notifications
You must be signed in to change notification settings - Fork 15.4k
KAFKA-16100: Add timeout to all the CompletableApplicationEvents #15455
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
Changes from 2 commits
a5c2bd9
69e1203
6ae929a
60682e0
b075b29
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -165,7 +165,7 @@ private void process(final SyncCommitEvent event) { | |
| } | ||
|
|
||
| CommitRequestManager manager = requestManagers.commitRequestManager.get(); | ||
| long expirationTimeoutMs = getExpirationTimeForTimeout(event.retryTimeoutMs()); | ||
| long expirationTimeoutMs = getExpirationTimeForTimeout(event.deadlineMs()); | ||
| CompletableFuture<Void> future = manager.commitSync(event.offsets(), expirationTimeoutMs); | ||
| future.whenComplete(complete(event.future())); | ||
| } | ||
|
|
@@ -177,7 +177,7 @@ private void process(final FetchCommittedOffsetsEvent event) { | |
| return; | ||
| } | ||
| CommitRequestManager manager = requestManagers.commitRequestManager.get(); | ||
| long expirationTimeMs = getExpirationTimeForTimeout(event.timeout()); | ||
| long expirationTimeMs = getExpirationTimeForTimeout(event.deadlineMs()); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct. This PR is intentionally limited in its design and scope. My hope was to leave that for this PR and rectify it as part of KAFKA-15974.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wait, I think we are misunderstanding each other. Method
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're right! Thanks for catching that! Previously, we used delta values and we're moving to absolute values. The absolute value is now calculated once in the |
||
| CompletableFuture<Map<TopicPartition, OffsetAndMetadata>> future = manager.fetchOffsets(event.partitions(), expirationTimeMs); | ||
| future.whenComplete(complete(event.future())); | ||
| } | ||
|
|
@@ -250,14 +250,14 @@ private void process(final ValidatePositionsEvent event) { | |
| } | ||
|
|
||
| private void process(final TopicMetadataEvent event) { | ||
| final long expirationTimeMs = getExpirationTimeForTimeout(event.timeoutMs()); | ||
| final long expirationTimeMs = getExpirationTimeForTimeout(event.deadlineMs()); | ||
| final CompletableFuture<Map<String, List<PartitionInfo>>> future = | ||
| requestManagers.topicMetadataRequestManager.requestTopicMetadata(event.topic(), expirationTimeMs); | ||
| future.whenComplete(complete(event.future())); | ||
| } | ||
|
|
||
| private void process(final AllTopicsMetadataEvent event) { | ||
| final long expirationTimeMs = getExpirationTimeForTimeout(event.timeoutMs()); | ||
| final long expirationTimeMs = getExpirationTimeForTimeout(event.deadlineMs()); | ||
| final CompletableFuture<Map<String, List<PartitionInfo>>> future = | ||
| requestManagers.topicMetadataRequestManager.requestAllTopicsMetadata(expirationTimeMs); | ||
| future.whenComplete(complete(event.future())); | ||
|
|
||
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.
I have two questions/comments here:
addAndGet()and use the timer of the event? To me, it seems like the timer passed to the event is always the timer also passed toaddAndGet().timer.remainingMs()when waiting for the future of the event? Do we not risk to timeout the future before we check the timer for expiration?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.
You're correct on both counts! 😄
Indeed it is the same
Timerobject. I intend to resolve that confusion as part of KAFKA-15974 and to keep this one smaller in scope.It is not, but the proper fix to change the underlying design is more substantial, so I was saving that change as part of KAFKA-15974.