diamondd raises an asynchronous exception when it receives a signal. However, the Python standard library is not async-exception safe. In particular, logging can fail to release its lock; we then try to log that we are exiting, and deadlock.
Worker threads use SIGUSR1 to report failures to the main thread, so this can be triggered by startup errors. Reproducer: configure an invalid Redis server, then run a search.
We need to initiate shutdown in a different way, such as by closing sockets.
diamondd raises an asynchronous exception when it receives a signal. However, the Python standard library is not async-exception safe. In particular,
logging
can fail to release its lock; we then try to log that we are exiting, and deadlock.Worker threads use SIGUSR1 to report failures to the main thread, so this can be triggered by startup errors. Reproducer: configure an invalid Redis server, then run a search.
We need to initiate shutdown in a different way, such as by closing sockets.