You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by no...@apache.org on 2020/12/29 12:30:23 UTC
[buildstream] 15/21: WIP: win32: job: signals / win32
This is an automated email from the ASF dual-hosted git repository.
not-in-ldap pushed a commit to branch aevri/win32
in repository https://gitbox.apache.org/repos/asf/buildstream.git
commit f7842602fdfdd6d9ca20ddc44fcc300c2b6af2f0
Author: Angelos Evripiotis <je...@bloomberg.net>
AuthorDate: Wed Jun 12 16:21:57 2019 +0100
WIP: win32: job: signals / win32
---
src/buildstream/_scheduler/jobs/job.py | 12 ++++++------
src/buildstream/_scheduler/scheduler.py | 4 +++-
src/buildstream/_signals.py | 4 ++++
3 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/src/buildstream/_scheduler/jobs/job.py b/src/buildstream/_scheduler/jobs/job.py
index debc470..2a25f40 100644
--- a/src/buildstream/_scheduler/jobs/job.py
+++ b/src/buildstream/_scheduler/jobs/job.py
@@ -289,7 +289,7 @@ class Job():
# the child process does not inherit the parent's state, but the main
# process will be notified of any signal after we launch the child.
#
- with _signals.blocked([signal.SIGINT, signal.SIGTSTP, signal.SIGTERM], ignore=False):
+ with _signals.blocked([signal.SIGINT, signal.SIGTERM], ignore=False):
self._process.start()
# Wait for the child task to complete.
@@ -772,15 +772,15 @@ class ChildJob():
# This avoids some SIGTSTP signals from grandchildren
# getting propagated up to the master process
- os.setsid()
+ #os.setsid()
# First set back to the default signal handlers for the signals
# we handle, and then clear their blocked state.
#
- signal_list = [signal.SIGTSTP, signal.SIGTERM]
- for sig in signal_list:
- signal.signal(sig, signal.SIG_DFL)
- signal.pthread_sigmask(signal.SIG_UNBLOCK, signal_list)
+ #signal_list = [signal.SIGTSTP, signal.SIGTERM]
+ #for sig in signal_list:
+ # signal.signal(sig, signal.SIG_DFL)
+ #signal.pthread_sigmask(signal.SIG_UNBLOCK, signal_list)
# Assign the queue we passed across the process boundaries
#
diff --git a/src/buildstream/_scheduler/scheduler.py b/src/buildstream/_scheduler/scheduler.py
index 8a14391..73157b0 100644
--- a/src/buildstream/_scheduler/scheduler.py
+++ b/src/buildstream/_scheduler/scheduler.py
@@ -201,7 +201,7 @@ class Scheduler():
# Block this until we're finished terminating jobs,
# this will remain blocked forever.
- signal.pthread_sigmask(signal.SIG_BLOCK, [signal.SIGINT])
+ #signal.pthread_sigmask(signal.SIG_BLOCK, [signal.SIGINT])
# jobs_suspended()
#
@@ -571,11 +571,13 @@ class Scheduler():
# Connects our signal handler event callbacks to the mainloop
#
def _connect_signals(self):
+ return
self.loop.add_signal_handler(signal.SIGINT, self._interrupt_event)
self.loop.add_signal_handler(signal.SIGTERM, self._terminate_event)
self.loop.add_signal_handler(signal.SIGTSTP, self._suspend_event)
def _disconnect_signals(self):
+ return
self.loop.remove_signal_handler(signal.SIGINT)
self.loop.remove_signal_handler(signal.SIGTSTP)
self.loop.remove_signal_handler(signal.SIGTERM)
diff --git a/src/buildstream/_signals.py b/src/buildstream/_signals.py
index 2df2c79..733f28e 100644
--- a/src/buildstream/_signals.py
+++ b/src/buildstream/_signals.py
@@ -135,6 +135,8 @@ def suspend_handler(sig, frame):
#
@contextmanager
def suspendable(suspend_callback, resume_callback):
+ yield
+ return
global suspendable_stack # pylint: disable=global-statement
outermost = bool(not suspendable_stack)
@@ -164,6 +166,8 @@ def suspendable(suspend_callback, resume_callback):
#
@contextmanager
def blocked(signal_list, ignore=True):
+ yield
+ return
with ExitStack() as stack: