scylladb / python-driver

ScyllaDB Python Driver, originally DataStax Python Driver for Apache Cassandra
https://python-driver.docs.scylladb.com
Apache License 2.0
70 stars 42 forks source link

Silently dropped future exceptions #306

Open muzarski opened 5 months ago

muzarski commented 5 months ago

In the driver's code there are places where we schedule an asynchronous task but ignore its result.

This can lead to silently ignoring exceptions thrown by the async task (e.g. https://github.com/scylladb/python-driver/commit/c7e6ebbdc7ff0c3c8d24d2a745479da615b0832d). Such behaviour is dangerous. It could lead to hours wasted on the debugging by users of the driver. It could even be the cause of some internal driver bugs.

There are multiple ways to approach the issue. I believe we should find the solution which not only gets rid of current occurrences of the problem, but also prevents the developers from introducing similar bugs in the future. One idea might be to introduce some wrapper over (Green)ThreadPoolExecutor which would log some message in case the async task threw an exception.