Fix fetch of task location in SpecificTaskServiceLocator#16462
Merged
cryptoe merged 3 commits intoapache:masterfrom May 20, 2024
Merged
Fix fetch of task location in SpecificTaskServiceLocator#16462cryptoe merged 3 commits intoapache:masterfrom
cryptoe merged 3 commits intoapache:masterfrom
Conversation
gianm
reviewed
May 18, 2024
Contributor
gianm
left a comment
There was a problem hiding this comment.
Generally LGTM other than the one exception handling thing.
| taskStatusFuture = overlordClient.taskStatus(taskId); | ||
| } | ||
| catch (Exception e) { | ||
| throw new RuntimeException(e); |
Contributor
There was a problem hiding this comment.
Should resolve pendingFuture in this case, I think. It would end up abandoned if an exception is actually thrown here.
Contributor
Author
There was a problem hiding this comment.
Thanks for catching this. Fixed.
gianm
approved these changes
May 19, 2024
adarshsanjeev
pushed a commit
to adarshsanjeev/druid
that referenced
this pull request
May 20, 2024
* Fix fetch of task location in SpecificTaskServiceLocator * Resolve future if exception occurs while invoking API * Remove unused import
adarshsanjeev
added a commit
that referenced
this pull request
May 21, 2024
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.
Description
The task status API was improved in #15724 to serve task statuses from the Overlord memory.
But on older Overlord versions, this API would return an
unknowntask status location causing failures in inter-task communications.This was later fixed in #16227 but that introduced another bug described below. This bug is typically reproducible in MSQ controller tasks but may occur in native batch ingestion as well.
SpecificTaskServiceLocatorfirst calls the multi-task status API/druid/indexer/v1/taskStatusto determine the location of a task.SpecificTaskServiceLocatorthen falls back to calling the single task status API/druid/indexer/v1/task/{taskId}/statusServiceClientFactorythreads to be stuck waiting to get back a task location. But to fetch the task location, we need one of theServiceClientFactorythreads.Fix
Testing
Local setup to reproduce issue:
f643abdad9and run overlord, coordinator, brokerf82cc34e5band run middle manager with 10 task slotsServiceClientFactorythreads are busy fetching task locationLocal setup to verify fix:
f643abdad9and run overlord, coordinator, brokerf82cc34e5b