Allow cancellation of MSQ tasks if they are waiting for segments to load#15000
Merged
cryptoe merged 3 commits intoapache:masterfrom Sep 22, 2023
Merged
Allow cancellation of MSQ tasks if they are waiting for segments to load#15000cryptoe merged 3 commits intoapache:masterfrom
cryptoe merged 3 commits intoapache:masterfrom
Conversation
Contributor
adarshsanjeev
left a comment
There was a problem hiding this comment.
Thanks for taking this up! Looks good apart from some minor comments
| private final int totalSegmentsGenerated; | ||
| private final boolean doWait; | ||
| // since live reports fetch the value in another thread, we need to use AtomicReference | ||
| private final AtomicReference<SegmentLoadWaiterStatus> status; |
Contributor
There was a problem hiding this comment.
If we are renaming the class, the status class might need to be renamed too
Contributor
Author
There was a problem hiding this comment.
Not really The status is an internal class class so I think we can let it remain as it is.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With PR #14322 , MSQ insert/Replace q's will wait for segment to be loaded on the historical's before finishing.
The patch introduces a bug where in the main thread had a thread.sleep() which could not be interuptted via the cancel calls from the overlord.
This new patch addressed that problem by moving the thread.sleep inside a thread of its own. Thus the main thread is now waiting on the future object of this execution.
The cancel call can now shutdown the executor service via another method thus unblocking the main thread to proceed.
This PR has: