You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pool/metadata management in the driver needs a refactor. It is currently a mess of thread pools, callbacks and random locks sprinkled in some places that are hard to understand. E.g. there is an assumption in the code on_add is called rarely enough that all the handling can be pretty much sequential. This is no longer the case, so the assumptions are violated. (See #317)
The solution would be to move to a model from Rust Driver (I think Java Driver does something very similar): there should be a thread (or asyncio task) that manages the cluster and pools. Driver communicates with it using messages. Then such task doesn't have to worry about concurrency because it is the only owner of the data. Apart from that each connection pool can have it's own task that manages the pool.
This model is easy to understand for developer that reads the code and nullifies most of the problem that we see here in Python Driver.
Pool/metadata management in the driver needs a refactor. It is currently a mess of thread pools, callbacks and random locks sprinkled in some places that are hard to understand. E.g. there is an assumption in the code
on_add
is called rarely enough that all the handling can be pretty much sequential. This is no longer the case, so the assumptions are violated. (See #317)The solution would be to move to a model from Rust Driver (I think Java Driver does something very similar): there should be a thread (or asyncio task) that manages the cluster and pools. Driver communicates with it using messages. Then such task doesn't have to worry about concurrency because it is the only owner of the data. Apart from that each connection pool can have it's own task that manages the pool.
This model is easy to understand for developer that reads the code and nullifies most of the problem that we see here in Python Driver.
Refs: #317 #380
The text was updated successfully, but these errors were encountered: