Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] [Worker] Match wrong pid on linux server #14646

Closed
2 of 3 tasks
Radeity opened this issue Jul 27, 2023 · 1 comment · Fixed by #14652
Closed
2 of 3 tasks

[Bug] [Worker] Match wrong pid on linux server #14646

Radeity opened this issue Jul 27, 2023 · 1 comment · Fixed by #14652
Assignees
Labels
bug Something isn't working good first issue good first issue

Comments

@Radeity
Copy link
Member

Radeity commented Jul 27, 2023

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

If you deploy DS on linux server, cancel process instance, then it's possible to get error log:

[ERROR] 2023-07-27 23:14:54.887 +0800 org.apache.dolphinscheduler.server.worker.processor.WorkerTaskKillProcessor:[196] - kill task error
org.apache.dolphinscheduler.common.shell.AbstractShell$ExitCodeException: kill: (26483): Operation not permitted
kill: (558): No such process
kill: (1493): No such process

What you expected to happen

No error log.

How to reproduce

Ditto.

Anything else

That is because in ProcessUtils.getPidsStr, only match pids on macos and windows.

        if (SystemUtils.IS_OS_MAC) {
            String pids = OSUtils.exeCmd(String.format("%s -sp %d", TaskConstants.PSTREE, processId));
            if (null != pids) {
                mat = MACPATTERN.matcher(pids);
            }
        } else {
            String pids = OSUtils.exeCmd(String.format("%s -p %d", TaskConstants.PSTREE, processId));
            mat = WINDOWSATTERN.matcher(pids);
        }

If run on linux server, will get pids string like: sudo(6279)---558_1497.sh(6282)---sleep(6354), but if use windows matcher, it will match "6279 558 1497 6282 6354", expected matching results is "6279 6282 6354".

Version

dev

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@Radeity Radeity added bug Something isn't working good first issue good first issue Waiting for reply Waiting for reply labels Jul 27, 2023
@Radeity Radeity added this to the 3.1.8 milestone Jul 27, 2023
@Radeity Radeity changed the title [Bug] [Module Name] Bug title [Bug] [Worker] get wrong pid on linux server Jul 27, 2023
@Radeity Radeity changed the title [Bug] [Worker] get wrong pid on linux server [Bug] [Worker] Match wrong pid on linux server Jul 27, 2023
@Radeity Radeity added help wanted Extra attention is needed and removed Waiting for reply Waiting for reply labels Jul 27, 2023
@CallMeKingsley97
Copy link
Contributor

I'll fix it

CallMeKingsley97 pushed a commit to CallMeKingsley97/dolphinscheduler that referenced this issue Jul 28, 2023
@SbloodyS SbloodyS removed the help wanted Extra attention is needed label Jul 28, 2023
CallMeKingsley97 pushed a commit to CallMeKingsley97/dolphinscheduler that referenced this issue Jul 28, 2023
CallMeKingsley97 pushed a commit to CallMeKingsley97/dolphinscheduler that referenced this issue Jul 28, 2023
CallMeKingsley97 pushed a commit to CallMeKingsley97/dolphinscheduler that referenced this issue Jul 28, 2023
CallMeKingsley97 pushed a commit to CallMeKingsley97/dolphinscheduler that referenced this issue Aug 4, 2023
CallMeKingsley97 pushed a commit to CallMeKingsley97/dolphinscheduler that referenced this issue Aug 4, 2023
@zhuangchong zhuangchong modified the milestones: 3.1.8, 3.1.9 Aug 15, 2023
Radeity pushed a commit that referenced this issue Aug 17, 2023
* [DS-14646][Worker] Fix match wrong pid on linux server
This closes #14646

---------

Co-authored-by: yangxin3 <[email protected]>
zhongjiajie pushed a commit that referenced this issue Aug 30, 2023
* [DS-14646][Worker] Fix match wrong pid on linux server
This closes #14646

---------

Co-authored-by: yangxin3 <[email protected]>
(cherry picked from commit b3af374)
@zhuangchong zhuangchong removed this from the 3.1.9 milestone Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue good first issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants