◐ Shell
clean mode source ↗

Message 234041 - Python tracker

While I tried to write an unit test to reproduce a bug (cancelled waiter), I noticed that the handshake callback of the protocol can be called indirectly from _process_write_backlog(). So _process_write_backlog() may be called indirectly from _process_write_backlog(), whereas this function doesn't support reentrant call.

A fix is to modify the handshake callback to schedule a call to _process_write_backlog(), instead of calling it immediatly.

Note: The shutdown callback doesn't have this issue, it only calls transport.close().