Open kinnarr opened 3 years ago
For normal stops, this actually prevents data loss. The workflow is (https://github.com/metricq/metricq-source-bacnet/blob/master/metricq_source_bacnet/source.py#L197-L218)
stop
function is called_bacnet_reader
is stopped_result_queue.join()
in the stop
function_result_queue
as usual_result_queue.join()
returns_main_task_stop_future
super.stop(...)
If stop is called because of an exception in the main task, _result_queue.join()
may block. So maybe we should call join with a timeout if exception is not None
We need a timeout for result_queue.join
in case the data connection died
The stop method is waiting with
result_queue.join()
. So we need to empty all results from queue before stop