Comment 0 for bug 1706588

Revision history for this message
milan k (vetrisko) wrote :

I'm trying to terminate a service[1] upon a periodics unrecoverable error through the on_failure callback. However, I'm unable to shut_down() the green thread pool executor:

(venv) jahoda:futurist_test mkovacik$ python test.py
DEBUG:Periodics Test Service:starting service
INFO:Periodics Test Service:Service running... Press CTRL+C to terminate.
DEBUG:futurist.periodics:Submitting periodic callback '__main__.clean_up'
DEBUG:Periodics Test Service:Cleaning up
DEBUG:futurist.periodics:Submitting periodic callback '__main__.clean_up'
DEBUG:Periodics Test Service:Cleaning up
WARNING:Periodics Test Service:Bad luck!
ERROR:Periodics Test Service:Callable <function clean_up at 0x10ec2e488> periodic, 10) encountered exc (<class 'RuntimeError'>, RuntimeError('Oops!',), <traceback object at 0x10ec277c8>) (None)
DEBUG:Periodics Test Service:stopping service
DEBUG:Periodics Test Service:stopping worker
DEBUG:Periodics Test Service:shutting down executor
ERROR:futurist.periodics:On failure callback <bound method Service.clean_up_watchdog of <__main__.Service object at 0x10ec1d240>> raised an unhandled exception. Error: Calling waitall() from within one of the GreenPool's greenthreads will never terminate.
DEBUG:futurist.periodics:Stopped running 1 callbacks:
+-------------------+------+----------+-----------+----------------+-----------------+-------------------------+
| Name | Runs | Failures | Successes | Stop Requested | Average elapsed | Average elapsed waiting |
+-------------------+------+----------+-----------+----------------+-----------------+-------------------------+
| __main__.clean_up | 2 | 1 | 1 | False | 0.0002s | 0.0005s |
+-------------------+------+----------+-----------+----------------+-----------------+-------------------------+
DEBUG:Periodics Test Service:stopping service
INFO:Periodics Test Service:Service sys.exit() time
(venv) jahoda:futurist_test mkovacik$

[1] http://paste.openstack.org/show/616565/