Skip to content

Support getTaskLocation for mixed task runner#15033

Merged
cryptoe merged 2 commits intoapache:masterfrom
georgew5656:fixGetTaskLocationMixedRunner
Sep 27, 2023
Merged

Support getTaskLocation for mixed task runner#15033
cryptoe merged 2 commits intoapache:masterfrom
georgew5656:fixGetTaskLocationMixedRunner

Conversation

@georgew5656
Copy link
Contributor

Description

The KubernetesAndWorkerTaskRunner currently doesn't implement getTaskLocation, so tasks run by it will show a unknown TaskLocation in the druid console after a task has completed.

Release note

Fix bug in KubernetesAndWorkerTaskRunner that manifests as missing information in the druid Web Console.

Key changed/added classes in this PR
  • KubernetesAndWorkerTaskRunner
  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • a release note entry in the PR description.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

@Override
public TaskLocation getTaskLocation(String taskId)
{
TaskLocation taskLocation = kubernetesTaskRunner.getTaskLocation(taskId);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the desired behavior if TaskLocation taskLocation = kubernetesTaskRunner.getTaskLocation(taskId); throws exception?

Shoudn't we fallback to workerTaskRunner ?

Copy link
Contributor Author

@georgew5656 georgew5656 Sep 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i feel it really probably shouldn't throw an exception b/c this is the logic
final KubernetesWorkItem workItem = tasks.get(taskId);
if (workItem == null) {
return TaskLocation.unknown();
} else {
return workItem.getLocation();
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i feel like its fine to propagate an exception up b/c something is probably v wrong if it does throw one

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough

Copy link
Contributor

@YongGang YongGang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@georgew5656 georgew5656 requested a review from cryptoe September 26, 2023 19:10
Copy link
Contributor

@cryptoe cryptoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM. Thanks for the patch @georgew5656!!

@cryptoe cryptoe merged commit 8e22a17 into apache:master Sep 27, 2023
@LakshSingla LakshSingla added this to the 28.0 milestone Oct 12, 2023
FrankChen021 pushed a commit that referenced this pull request Feb 3, 2025
The KubernetesAndWorkerTaskRunner currently doesn't implement getTaskLocation, so tasks run by it will show a unknown TaskLocation in the druid console after a task has completed.

Fix bug in KubernetesAndWorkerTaskRunner that manifests as missing information in the druid Web Console.
GabrielCWT pushed a commit to GabrielCWT/druid that referenced this pull request Sep 9, 2025
The KubernetesAndWorkerTaskRunner currently doesn't implement getTaskLocation, so tasks run by it will show a unknown TaskLocation in the druid console after a task has completed.

Fix bug in KubernetesAndWorkerTaskRunner that manifests as missing information in the druid Web Console.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants