Open AgDude opened 5 years ago
This appears to be caused by the use of threading.Timer()
in both the HeartbeaterService
and the WavefrontDirectClient
. In the case of the HeartbeaterService
the interval is 5 minutes, which will cause the main thread to block for that long if it tries to exit without closing the heartbeater first.
This issue is going to prevent us from moving this into production. I have observed this currently with both runserver
and shell
, but it appears it will impact server processes as well, which are expected to exit or restart based on signals.
It looks like this could be addressed by setting _timer.daemon = True
everywhere a timer is used.
This does have the implication of losing pending messages before they are sent if the client is not properly closed. Personally I would consider that a seperate issue, and it could either be left to the application developer to implement handlers to properly close connections, or the SDK could listen for SIGINT
and cleanly close the clients/reporters.
Is this now fixed with https://github.com/wavefrontHQ/wavefront-sdk-python/pull/48 ?
With wavefront configured, open a django shell:
python manage.py shell
then Exit the shell withexit()
start the django development server like
python manage.py runserver
, then typectrl-c
to stop the server.In both of these cases the process hangs indefinitely, and does not exit.
The autoreload on file changes for the development server also does not work with wavefront configured.