boostorg / mysql

MySQL C++ client based on Boost.Asio
https://www.boost.org/doc/libs/master/libs/mysql
Boost Software License 1.0
252 stars 32 forks source link

Race condition in per-operation cancellation in connection/any_connection #199

Open anarthal opened 8 months ago

anarthal commented 8 months ago

This is a rare case of a race condition that can happen during the execution of any connection function. If the cancellation signal is emitted while the current async op is complete, but the handler hasn't been called yet (is queued), the cancellation has no effect and the operation continues.

This can be fixed by checking the composed op's cancellation state in async_run_algo_impl.