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
But this leads to problems, because MultiBackend.drain_events method calls MutiBackend.channel, which opens up a new connection… But there is no reference to that connection from the connection returned by establish_connection.
For example:
>>> conn = establish_connection.establish_connection()
>>> conn.drain_events() # creates a new connection
...
>>> conn.close()
This code looks correct, but will in fact leave a dangling connection (ie, the one created during drain_events).
This is a problem because carrot.connection.BrokerConnection._establish_connection is:
In the
establish_connection
method ofMultiBackend
, it monkey patches the connection'sdrain_events
method:But this leads to problems, because
MultiBackend.drain_events
method callsMutiBackend.channel
, which opens up a new connection… But there is no reference to that connection from the connection returned byestablish_connection
.For example:
This code looks correct, but will in fact leave a dangling connection (ie, the one created during
drain_events
).This is a problem because
carrot.connection.BrokerConnection._establish_connection
is:Which means that a backend is being created, but no reference is kept to it. So, for example:
Will leave a dangling connection with no direct references (ie, because the only reference is through
conn.drain_events
).The text was updated successfully, but these errors were encountered: