[Question] [worker] workflow killed not success
Search before asking
- [x] I had searched in the issues and found no similar issues.
What happened
Sending SIGINT to process group: 2737277 2737283, command: sudo -u dolphinscheduler -i kill -s SIGINT 2737277 2737283 2025-11-28 13:54:44.630 ERROR - Error sending SIGINT to process: 2737277 2737283 org.apache.dolphinscheduler.common.shell.AbstractShell$ExitCodeException: -sh: line 1: kill: SIGINT: invalid signal specification
at org.apache.dolphinscheduler.common.shell.AbstractShell.runCommand(AbstractShell.java:205)
at org.apache.dolphinscheduler.common.shell.AbstractShell.run(AbstractShell.java:118)
at org.apache.dolphinscheduler.common.shell.ShellExecutor.execute(ShellExecutor.java:125)
at org.apache.dolphinscheduler.common.shell.ShellExecutor.execCommand(ShellExecutor.java:103)
at org.apache.dolphinscheduler.common.shell.ShellExecutor.execCommand(ShellExecutor.java:86)
at org.apache.dolphinscheduler.common.utils.OSUtils.exeShell(OSUtils.java:342)
at org.apache.dolphinscheduler.common.utils.OSUtils.exeCmd(OSUtils.java:331)
at org.apache.dolphinscheduler.plugin.task.api.utils.ProcessUtils.sendKillSignal(ProcessUtils.java:176)
at org.apache.dolphinscheduler.plugin.task.api.utils.ProcessUtils.kill(ProcessUtils.java:120)
at org.apache.dolphinscheduler.plugin.task.api.AbstractCommandExecutor.cancelApplication(AbstractCommandExecutor.java:217)
at org.apache.dolphinscheduler.plugin.task.shell.ShellTask.cancel(ShellTask.java:106)
at org.apache.dolphinscheduler.server.worker.executor.PhysicalTaskExecutor.kill(PhysicalTaskExecutor.java:105)
at org.apache.dolphinscheduler.task.executor.listener.TaskExecutorLifecycleEventListener.onTaskExecutorKillLifecycleEvent(TaskExecutorLifecycleEventListener.java:88)
at org.apache.dolphinscheduler.task.executor.eventbus.TaskExecutorEventBusCoordinator.doFireTaskExecutorEventBus(TaskExecutorEventBusCoordinator.java:167)
at org.apache.dolphinscheduler.task.executor.eventbus.TaskExecutorEventBusCoordinator.lambda$fireTaskExecutorEventBus$1(TaskExecutorEventBusCoordinator.java:124)
at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:714)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1742)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
What you expected to happen
ProcessUtil.java=>sendKillSignal=> String killCmd = String.format("kill -s %s %s", signal, pids); cannot always kill
How to reproduce
kill workflow
Anything else
No response
Version
dev
Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
Code of Conduct
- [x] I agree to follow this project's Code of Conduct
The main reason is that -sh: line 1: kill: SIGINT: invalid signal specification
DS uses bash syntax to execute the kill command. Your current environment is sh. Please switch to bash. @a819721810
The main reason is that
-sh: line 1: kill: SIGINT: invalid signal specificationDS uses
bashsyntax to execute the kill command. Your current environment issh. Please switch tobash. @a819721810
but i cannot choose which sh is use, i just upgrade, then i cannot use. You can fix "sh" problem ?
@SbloodyS a819721810 is correct. Using kill -s SIGINT [pid] may throw 'invalid signal specification' in some shells, for example /bin/sh. DS can not guarantee execution in bash. Using kill -2 [pid] is the most compatible choice for ProcessUtils.kill().
Please assign this issue to me to fix.
@SbloodyS a819721810 is correct. Using
kill -s SIGINT [pid]may throw 'invalid signal specification' in some shells, for example/bin/sh. DS can not guarantee execution in bash. Usingkill -2 [pid]is the most compatible choice forProcessUtils.kill(). Please assign this issue to me to fix.
This sounds good. We should change other similar ones into common writing.