The python interpreter handles SIGINT regularly between instruction. However, it doesn't do it durring FFI calls. So when we wait_for_future for a long time (e.g because the server is slow or stalling), ctrl-C doesn't interrupt the waiting.
It would appear that the solution to that is to use [PyErr_CheckSignals](https://docs.python.org/3/c-api/exceptions.html#c.PyErr_CheckSignals). We could poll it in parallel to f in the implementation of wait_for_future, and early out with an Interrupted error. Maybe?
Background:
The python interpreter handles SIGINT regularly between instruction. However, it doesn't do it durring FFI calls. So when we
wait_for_futurefor a long time (e.g because the server is slow or stalling), ctrl-C doesn't interrupt the waiting.It would appear that the solution to that is to use
[PyErr_CheckSignals](https://docs.python.org/3/c-api/exceptions.html#c.PyErr_CheckSignals). We could poll it in parallel tofin the implementation ofwait_for_future, and early out with anInterruptederror. Maybe?Background: