Skip to content

[Fix-18697][TaskPlugin] Fix DinkyTask worker interrupt leak - #18771

Merged
SbloodyS merged 2 commits into
apache:devfrom
lihanyu1715446406-afk:Fix-18697
Nov 7, 2026
Merged

SbloodyS merged 2 commits into
apache:devfrom
lihanyu1715446406-afk:Fix-18697

Conversation

@lihanyu1715446406-afk

Copy link
Copy Markdown
Contributor

Was this PR generated or assisted by AI?

YES. The root-cause analysis, the regression tests and this description were drafted with AI assistance (Claude Code). The change was reviewed and verified locally by the submitter, including a before/after run of the new tests.

Purpose of the pull request

Fixes #18697. DinkyTask.submitApplicationV0() and submitApplicationV1() restore the interrupt flag in a catch (Exception) block even though the try block only performs HTTP calls and JSON parsing. When a Dinky submit fails, the flag is set on the worker's TaskExecutorWorker thread. The next Condition.await() then throws InterruptedException, the worker breaks out of its loop and its slot is never submitted again. Repeating this eventually exhausts the fixed pool (All ExclusiveThreadTaskExecutorWorker are busy).

Brief change log

  • Remove the two spurious Thread.currentThread().interrupt() calls from the submit-failure paths. trackApplicationStatusV0/V1 still restore the flag in their real catch (InterruptedException) blocks.
  • Add DinkyTaskTest with two regression tests (dinky 0.x and 1.x) that fail the submit call via a local HTTP server and assert that the task throws TaskException while the worker thread's interrupt flag stays clear.

Verify this pull request

This change added tests and can be verified as follows:

  • ./mvnw -pl dolphinscheduler-task-plugin/dolphinscheduler-task-dinky -Dtest=DinkyTaskTest test
  • Before the fix: both tests fail with a failed submit must not leave the worker thread interrupted ==> expected: <false> but was: <true>.
  • After the fix: Tests run: 2, Failures: 0, Errors: 0, Skipped: 0.

This PR intentionally stays scoped to the interrupt leak. The secondary defensive liveness check in TaskExecutorWorkers#selectIdleWorker() is not changed here.

- Remove spurious Thread.currentThread().interrupt() from submit failure paths
- Add regression tests for dinky 0.x and 1.x submit failures
@boring-cyborg

boring-cyborg Bot commented Nov 5, 2026

Copy link
Copy Markdown

Thanks for opening this pull request! Please check out our contributing guidelines. (https://github.com/apache/dolphinscheduler/blob/dev/docs/docs/en/contribute/join/pull-request.md)

@SbloodyS SbloodyS added bug Something isn't working first time contributor First-time contributor labels Nov 6, 2026
@SbloodyS SbloodyS added this to the 3.5.0 milestone Nov 6, 2026

@SbloodyS SbloodyS left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@SbloodyS
SbloodyS merged commit 0250417 into apache:dev Nov 7, 2026
118 of 119 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend bug Something isn't working first time contributor First-time contributor test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug][Task] DinkyTask spuriously interrupts the worker thread, permanently leaking worker slots`

2 participants