Change in vdsm[master]: signals: Handle signals to non-main threads

dkuznets at redhat.com dkuznets at redhat.com
Sun Dec 28 14:33:05 UTC 2014


Dima Kuznetsov has posted comments on this change.

Change subject: signals: Handle signals to non-main threads
......................................................................


Patch Set 20:

(3 comments)

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
> Can be simpler and more clear:
Done
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
Done
Line 61:     signal.set_wakeup_fd(write_fd)
Line 62: 
Line 63:     poller = select.poll()
Line 64:     poller.register(read_fd, select.POLLIN)


Line 80: 
Line 81:     if _signal_poller is None:
Line 82:         raise RuntimeError("Attempt to wait on signal before calling register")
Line 83: 
Line 84:     # poll() timeout is in millies
> millies -> milliseconds
Done
Line 85:     if timeout is not None:
Line 86:         timeout *= 1000
Line 87: 
Line 88:     try:


-- 
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