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
ConnectManager causes hour-long bug stalking in some cases :-)
Scenario:
An application is doing something with redis, then it have to calculate something terribly big. In order to do it faster, it forks. Each fork creates new Redis() instance.
The problem is that connection is reused, and all forked processes share socket, and it causes magic bugs because you haven't asked for connection sharing but it's there! :)
Solve to problem:
Redis instance should accept keyword argument connection_pool=None.
And keep connection_manager inside itself instead on module-level.
I can write a fix in few minutes, but I want to clarify this:
Why share connections by default? I think that pool must be explicit rather than implicit.
The text was updated successfully, but these errors were encountered:
ConnectManager causes hour-long bug stalking in some cases :-)
Scenario:
An application is doing something with redis, then it have to calculate something terribly big. In order to do it faster, it forks. Each fork creates new Redis() instance.
The problem is that connection is reused, and all forked processes share socket, and it causes magic bugs because you haven't asked for connection sharing but it's there! :)
Solve to problem:
Redis instance should accept keyword argument connection_pool=None.
And keep connection_manager inside itself instead on module-level.
I can write a fix in few minutes, but I want to clarify this:
Why share connections by default? I think that pool must be explicit rather than implicit.
The text was updated successfully, but these errors were encountered: