« Previous | Next » 

Revision 21f59a5d

ID21f59a5d644e092b249ab75308da2cc14bde3059

Added by Vangelis Koukis about 13 years ago

Use zmq_recv() in dedicated thread in db_controller.

It seems Python can only do signal processing in the main thread.
If the main thread calls zmq_recv(), no exceptions get raised
when a SIGINT is received for example.

WIP:
This moves the zmq_recv() to a separate thread, while the main
thread can raise and process KeyboardInterrupt exceptions on SIGINT
delivery to the process and perform any necessary clean-up (e.g. remove
pidfiles) before exiting.

sys.exit() does not work in the main thread, because it seems to want
to join the forever-blocked-in-zmq_recv() thread.

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences