-
Notifications
You must be signed in to change notification settings - Fork 257
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
Flush the merge-wait queue on SIGUSR2 #1406
base: master
Are you sure you want to change the base?
Flush the merge-wait queue on SIGUSR2 #1406
Conversation
If portage receives SIGUSR2, then flush the merge-wait queue on the next possible occasion (typically after all running "install" jobs are finished). Signed-off-by: Florian Schmaus <[email protected]>
@@ -1193,6 +1199,10 @@ def sighandler(signum, frame): | |||
signal.signal(signal.SIGCONT, earlier_sigcont_handler) | |||
else: | |||
signal.signal(signal.SIGCONT, signal.SIG_DFL) | |||
if earlier_sigusr2_handler is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to do this now, but I wonder if we could do bette rwith this with a context manager.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would require creating a custom context manager class for signals, right?
self._merge_wait_queue | ||
and not self._jobs | ||
and not self._task_queues.merge | ||
if self._merge_wait_queue and ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be nice as a variable instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if I understand. "This" being _merge_wait_queue
and you want something like merge_wait_queue_not_empty
?
If portage receives SIGUSR2, then flush the merge-wait queue on the next possible occasion (typically after all running "install" jobs are finished).