Change in vdsm[master]: signals: Handle signals to non-main threads
ybronhei at redhat.com
ybronhei at redhat.com
Thu Dec 11 08:00:11 UTC 2014
Yaniv Bronhaim has posted comments on this change.
Change subject: signals: Handle signals to non-main threads
......................................................................
Patch Set 20:
(2 comments)
looks good to me, although I agree with nir's suggestion regarding cleaning the pipe
http://gerrit.ovirt.org/#/c/29392/20/lib/vdsm/infra/sigutils/__init__.py
File lib/vdsm/infra/sigutils/__init__.py:
Line 45: raise RuntimeError('register was already called')
Line 46:
Line 47: read_fd, write_fd = os.pipe()
Line 48:
Line 49: # The write end is going to be written to from a c-level signal
s/to/
Line 50: # handler, so it has to be non-blocking.
Line 51: filecontrol.set_non_blocking(write_fd)
Line 52:
Line 53: # Set the read pipe end to non-blocking too, just in case.
Line 56: # Prevent subproccesses we execute from inheriting the pipes.
Line 57: filecontrol.set_close_on_exec(write_fd)
Line 58: filecontrol.set_close_on_exec(read_fd)
Line 59:
Line 60: # This call must be done from the main thread.
already been said
Line 61: signal.set_wakeup_fd(write_fd)
Line 62:
Line 63: poller = select.poll()
Line 64: poller.register(read_fd, select.POLLIN)
--
To view, visit http://gerrit.ovirt.org/29392
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I5dbcd00cec22ef12f2b6253b016dcbd0aa889583
Gerrit-PatchSet: 20
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dima Kuznetsov <dkuznets at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Dima Kuznetsov <dkuznets at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: Yeela Kaplan <ykaplan at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: mooli tayer <mtayer at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list