Skip to content

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.

2 participants