Re: [Orbit-python-list] Catching SIGINT inside orb.run()
Status: Inactive
Brought to you by:
tack
From: Jason T. <ta...@li...> - 2000-11-30 02:46:03
|
> If you have an idea of where I can start looking I promise I'll try > digging in myself, so let me know. I believe I've found the source of the problem, but I'm not confident I know how to fix it. From the documentation for the signal module: - Although Python signal handlers are called asynchronously as far as the Python user is concerned, they can only occur between the ``atomic'' instructions of the Python interpreter. This means that signals arriving during long calculations implemented purely in C (e.g. regular expression matches on large bodies of text) may be delayed for an arbitrary amount of time. When the ORB's run method is called, it in turn calls CORBA_ORB_run which starts the main loop. So, control is not returned to the Python interpreter until a CORBA event happens. This means by using the signal module, if the program receives a signal for which a custom handler is installed, the handler will not be called until some event happens (a client invokes a method from the server, or the ORB exits, for example). One possible fix would be to install a custom handler for all signals just before entering CORBA_ORB_run that somehow allows the interpreter to take control in order to call the handler set using the signal module. I have a hunch this may not be the best solution. :) Surely someone else has had to deal with this problem. I'd love some help in resolving this. It's probably nothing a note to c.l.p couldn't solve, but if anyone on this list has some insight, please speak up. :) Jason. |