Skip to content

Dead lock if cancellation is requested while there is a PING request on the fly #29

Closed
@nejati-deriv

Description

@nejati-deriv

I'm not sure but problem seems to be here.
If I am not mistaken you used close_on_run_completion flag exactly to prevent this situation but I don't know why it leads to dead lock any way.

You can reproduce it with a loop like:

for (;;)
{
    auto timer = asio::steady_timer{ executor, std::chrono::seconds{ 1 } };
    co_await (connection.async_run(endpoint, asio::use_awaitable) || timer.async_wait(asio::use_awaitable));
}

if you change timer to something shorter than ping time like 800ms it will not lead to dead lock.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions