amaechler opened a new pull request, #20738:
URL: https://github.com/apache/druid/pull/20738

   ### Description
   
   A task killed while waiting for a free `KubernetesTaskRunner` thread is 
still launched once a thread frees up. Since #16036, `shutdown()` keeps work 
items whose future is not done, and `KubernetesPeonLifecycle.shutdown()` does 
nothing in `NOT_STARTED`, so `doTask()` later runs the job for a task the 
Overlord has already failed.
   
   - `doTask()` returns a FAILED status without launching when the work item 
was shut down. For restored jobs it saves the logs first.
   - `KubernetesPeonLifecycle.shutdown()` moves `NOT_STARTED` to `STOPPED` and 
always deletes the job, so a racing `run()` or `join()` cannot launch it.
   
   #20298 tracks the same bug in `HttpRemoteTaskRunner`.
   
   #### Release note
   
   Fixed an issue where a task killed while waiting for capacity in the 
Kubernetes task runner was still launched.
   
   <hr>
   
   ##### Key changed/added classes in this PR
    * `KubernetesTaskRunner`
    * `KubernetesPeonLifecycle`
   
   <hr>
   
   This PR has:
   
   - [x] been self-reviewed.
      - [x] using the [concurrency 
checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md)
 (Remove this item if the PR doesn't have any relation to concurrency.)
   - [x] a release note entry in the PR description.
   - [x] added unit tests or modified existing tests to cover new code paths, 
ensuring the threshold for [code 
coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md)
 is met.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to