Load getTaskLocation on task startup in mmless ingestion #17350
Merged
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.
Fixes a bug with mmless ingestion when overlord leadership is rolled over.
Description
When a overlord newly attains leadership in a cluster running mmless ingestion, it will load all the running tasks from kubernetes, but not the value of taskLocation. taskLocation is populated the first time getTaskLocation() is called on each task.
The problem with this is getTaskLocation is called in the serviceLocator.locate() method, which runs under the ServiceClientFactory thread pool and is not supposed to make a lot of network calls. Frequently the first caller (before taskLocation is cached) is a supervisor trying to contact its tasks. If there are many supervisors and kafka tasks running in the cluster, the ServiceClientFactory threads can get stuck trying to call locate() (since the function will block on reaching out to k8s for the pod ips).
Fixed the bug ...
Renamed the class ...
Added a forbidden-apis entry ...
Since we don't actually need to update taskLocation (the pod IP is static through the lifetime of a k8s pod and we don't retry jobs), we can just load taskLocation right after the pod has started (in the join method).
Release note
Key changed/added classes in this PR
KubernetesPeonLifecycle
This PR has: