Repository navigation
Try to fetch the status for an active task from memory #15724
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 all commits
bc1ab96
8f0f623
344994d
ae53f45
58b0c19
1e9fff8
103e48e
38458c9
5ad9855
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 |
|---|---|---|
|
|
@@ -469,9 +469,15 @@ public Response getMultipleTaskStatuses(Set<String> taskIds) | |
| return Response.status(Response.Status.BAD_REQUEST).entity("No TaskIds provided.").build(); | ||
| } | ||
|
|
||
| final Optional<TaskQueue> taskQueue = taskMaster.getTaskQueue(); | ||
| Map<String, TaskStatus> result = Maps.newHashMapWithExpectedSize(taskIds.size()); | ||
| for (String taskId : taskIds) { | ||
| Optional<TaskStatus> optional = taskStorageQueryAdapter.getStatus(taskId); | ||
| final Optional<TaskStatus> optional; | ||
| if (taskQueue.isPresent()) { | ||
|
Contributor
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. If the task is not present in the
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. TaskQueue#getStatus looks at the metadata store if the task is not running Would it be better to move this fallback to db logic out of the TaskQueue in the calling method?
Contributor
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. Ah, I see, I didn't realize that the fallback logic was in the |
||
| optional = taskQueue.get().getTaskStatus(taskId); | ||
| } else { | ||
| optional = taskStorageQueryAdapter.getStatus(taskId); | ||
| } | ||
| if (optional.isPresent()) { | ||
| result.put(taskId, optional.get()); | ||
| } | ||
|
|
||
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.
We need the same change in
SpecificTaskServiceLocator, to usetaskStatusesinstead oftaskStatus.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