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

scripts/pkgbuilder.py: assign each subprocess a process group #4177

Merged
merged 3 commits into from Feb 19, 2020
Merged

scripts/pkgbuilder.py: assign each subprocess a process group #4177

merged 3 commits into from Feb 19, 2020

Conversation

MilhouseVH
Copy link
Contributor

When pkgbuilder.py is terminated with SIGINT (ie. ctrl-c), or exits
immediately due to a failed job, it is sometimes possible for child
subprocesses (ie. build tasks) to remain alive and continue running
in the background.

To fix this, assign each subprocess a new process group identifier,
and capture the pid of each child subprocess so that on shutdown we
can kill the entire child process group (ie. kill the child subprocess,
and all subprocesses the child subprocess may have created) for any
builder processes that are still running.

@MilhouseVH
Copy link
Contributor Author

Updated to use start_new_session=True instead of preexec_fn=os.setsid.

@MilhouseVH
Copy link
Contributor Author

MilhouseVH commented Feb 6, 2020

Added "realtime status" feature, showing elapsed time, percentage complete, 1 min load, available mem, idle and build counts, and currently building packages on stderr.

Enabled with MTPROGRESS=yes.

s1

@MilhouseVH
Copy link
Contributor Author

Multi-line approach should be less cluttered.

s1

When pkgbuilder.py is terminated with SIGINT (ie. ctrl-c), or exits
immediately due to a failed job, it is sometimes possible for child
subprocesses (ie. build tasks) to remain alive and continue running
in the background.

To fix this, assign each subprocess a new process group identifier,
and capture the pid of each child subprocess so that on shutdown we
can kill the entire child process group (ie. kill the child subprocess,
and all subprocesses the child subprocess may have created) for any
builder processes that are still running.
@dhewg dhewg merged commit c6e17d2 into LibreELEC:master Feb 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants