You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by "zhuxiangyi (via GitHub)" <gi...@apache.org> on 2026/06/01 23:44:02 UTC
[PR] [Fix-18311][TaskPlugin] Fix task process kill status check [dolphinscheduler]
zhuxiangyi opened a new pull request, #18312:
URL: https://github.com/apache/dolphinscheduler/pull/18312
## Was this PR generated or assisted by AI?
YES. Codex/ChatGPT assisted with debugging, code changes, tests, issue drafting, and PR draft preparation. I reviewed the changes and verified them locally.
## Purpose of the pull request
Fix task kill status checking when `kill -0` returns `Operation not permitted` for an unkillable sudo parent process or when tenant login shell emits stderr with exit code 0.
Closes #18311.
## Brief change log
- Add exit code accessor to `ExitCodeException`.
- Distinguish alive, not-alive, and no-permission process states in `ProcessUtils`.
- Continue killing permitted child processes instead of reporting success when only the sudo parent check is denied.
- Add unit coverage for sudo parent denied plus killable child processes.
## Verify this pull request
This change added tests and can be verified as follows:
- `./mvnw -pl dolphinscheduler-common,dolphinscheduler-task-plugin/dolphinscheduler-task-api -DskipTests -Djacoco.skip=true spotless:check`
- `./mvnw -pl dolphinscheduler-task-plugin/dolphinscheduler-task-api -am -Dspotless.check.skip=true -Djacoco.skip=true -Dsurefire.failIfNoSpecifiedTests=false -Dtest=ProcessUtilsTest test`
## Pull Request Notice
[Pull Request Notice](https://github.com/apache/dolphinscheduler/blob/dev/docs/docs/en/contribute/join/pull-request.md)
If your pull request contains incompatible change, you should also add it to `docs/docs/en/guide/upgrade/incompatible.md`.
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix-18311][TaskPlugin] Fix task process kill status check [dolphinscheduler]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #18312:
URL: https://github.com/apache/dolphinscheduler/pull/18312#issuecomment-4599553457
## [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=18312) **Quality Gate failed**
Failed conditions
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=18312&metric=new_coverage&view=list) (required ≥ 60%)
<!-- sqra:qg_revision=ffcad989631be855bd2048a09cc0e2e4a24d782ed09bcb12bb53d8f464cd939a -->
<!-- sqra-placement-anchor -->
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=18312)
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix-18311][TaskPlugin] Fix task process kill status check [dolphinscheduler]
Posted by "zhuxiangyi (via GitHub)" <gi...@apache.org>.
zhuxiangyi commented on PR #18312:
URL: https://github.com/apache/dolphinscheduler/pull/18312#issuecomment-4602008597
@SbloodyS Could you review this PR for me?
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix-18311][TaskPlugin] Fix task process kill status check [dolphinscheduler]
Posted by "zhuxiangyi (via GitHub)" <gi...@apache.org>.
zhuxiangyi commented on PR #18312:
URL: https://github.com/apache/dolphinscheduler/pull/18312#issuecomment-4610989410
> This repair way is not very good. The UI does not classify the result type of kill. If we want to do this, we should first discuss how to show this type to users in the UI, and then decide how to realize it. cc @ruanwenjun
@SbloodyS Thanks for the review. I agree that exposing kill result types to users should be discussed separately. This PR does not intend to introduce a new user-visible kill state. The main problem here is that the worker currently treats any exception from `kill -0` as "process not alive", which can cause a false successful kill log while child processes are still alive.
I can narrow this PR to only fix the false process-alive detection and avoid introducing a user-visible kill result classification.
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix-18311][TaskPlugin] Fix task process kill status check [dolphinscheduler]
Posted by "SbloodyS (via GitHub)" <gi...@apache.org>.
SbloodyS commented on PR #18312:
URL: https://github.com/apache/dolphinscheduler/pull/18312#issuecomment-4611050261
I don't think this needs to be repaired separately. Since this case will only appear when the user has no authority, it is a small probability event and can be easily avoided before deployment.
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix-18311][TaskPlugin] Fix task process kill status check [dolphinscheduler]
Posted by "zhuxiangyi (via GitHub)" <gi...@apache.org>.
zhuxiangyi commented on PR #18312:
URL: https://github.com/apache/dolphinscheduler/pull/18312#issuecomment-4743989464
@SbloodyS Thanks for the review. I agree the kill-result classification (and how to surface it in the UI) deserves its own discussion, so I've narrowed this PR to a minimal, behavior-preserving fix and dropped the user-visible parts.
What remains is purely a false-negative in liveness detection: AbstractShell throws ExitCodeException whenever stderr is non-empty even if the exit code is 0 (e.g. the tenant login shell printing HISTSIZE: readonly variable warnings). Because isProcessAlive treated any exception as "not alive", the still-alive children were misclassified as terminated and the kill signal was never actually sent — hence All processes already terminated while ps showed the tree alive. The fix is one branch: kill -0 raising ExitCodeException with exit code 0 ⇒ alive. No change to kill semantics, no new user-visible state.
I've removed the NO_PERMISSION / return false for the root-owned sudo parent — that part touches kill-result semantics and I'll raise it separately. In #18311 it isn't needed anyway: once the tenant-owned children are killed, the sudo parent exits on its own.
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix-18311][TaskPlugin] Fix task process kill status check [dolphinscheduler]
Posted by "SbloodyS (via GitHub)" <gi...@apache.org>.
SbloodyS closed pull request #18312: [Fix-18311][TaskPlugin] Fix task process kill status check
URL: https://github.com/apache/dolphinscheduler/pull/18312
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org