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

Subprocesses and Interruption #35

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ses1112
Copy link

@ses1112 ses1112 commented Mar 8, 2022

This pull request adresses to issues: Killing subprocesses and interrupting of a running process.

Subprocesses
If a process spawns subprocesses, these processes are not destroyed in killProcessCleanup. Therefor are ProcessHandle is necessary.

** Interrupting **
A running process can be stopped if the corresponding thread is interrupted. If this happens, no exit code is available. If a java process is destroyed, the process returns exit code 1.
Change: If the thread is interrupted, the process is killed/destroyed, but no exception is thrown. The control thread finishs normally and sets the exit code to 1 and dispatches the event "PROCESS_EXITED". The original thread finishs also normally without exception. In ProcBuilder the correct result will be created.

@fleipold
Copy link
Owner

@ses1112 thank you for your contribution. These are interesting problems.
As you have probably seen the documentation in README.md is generated from the acceptance test.
It would be nice to document the two changes with a test case. Perhaps you can come up with them (ideally they would work on linux and macos)?

Potentially the killing of subprocesses should be configurable. What do you think?

@ses1112
Copy link
Author

ses1112 commented Mar 13, 2022

Configurable sounds good, should this be a method in the ProcBuilder? And default false because of compatibility to older versions?

I can try to create a test for interrupting a running process, but for subprocess i don't know how i could make one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants