Tags: michaeljmarshall/pulsar-client-python
Tags
Fixed deadlock in producer.send_async (apache#87) Fix apache#84 Release the GIL while calling `producer.sendAsync()` to avoid a deadlock when PyBind is triggering the Python callback. * Main Thread 1. Holds the Python GIL 2. Call `producer.send_async()` 3. Tries to acquire internal `ClientConnetion` lock * Pulsar client internal thread 1. Holds lock on `ClientConnection` 2. Receives ack from the broker 3. Triggers callback 4. PyBind11 acquires GIL <---- Deadlock The problem is the different behavior in PyBind from Boost::Python. We always need to make sure we release the GIL before making any call to C++ that potentially acquires any mutexes