eandersson / amqpstorm

Thread-safe Python RabbitMQ Client & Management library
MIT License
188 stars 36 forks source link

Fix a potential deadlock at channel creation [#97] #98

Closed eandersson closed 3 years ago

eandersson commented 3 years ago

It was possible that _cleanup_channel would get called during channel open and trigger a deadlock. Reported in #97 .

jhogg commented 3 years ago

Erik,

You may want to pull the self.on_close_impl assignment inside the lock block, but after the open. There is a very small race condition window after the lock is released (context switch) but before the on_close_impl is assigned that something could happen to the connection.

Jay

eandersson commented 3 years ago

Thanks @jhogg. I opened a new PR. Can you take a look when you have time? https://github.com/eandersson/amqpstorm/pull/99