Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JsonRpcConnection: Don't read any data on shutdown #10213

Merged
merged 1 commit into from
Nov 7, 2024

Commits on Oct 31, 2024

  1. JsonRpcConnection: Don't read any data on shutdown

    When the `Desconnect()` method is called, clients are not disconnected
    immediately. Instead, a new coroutine is spawned using the same strand
    as the other coroutines. This coroutine calls `async_shutdown` on the
    TCP socket, which might be blocking. However, in order not to block
    indefintely, the `Timeout` class cancels all operations on the socket
    after `10` seconds. Though, the timeout does not trigger the handler
    immediately; it creates spawns another coroutine using the same strand
    as in the `JsonRpcConnection` class. This can cause unexpected delays if
    e.g. `HandleIncomingMessages` gets resumed before the coroutine from the
    timeout class. Apart from that, the coroutine for writing messages uses
    the same condition, making the two symmetrical.
    yhabteab committed Oct 31, 2024
    Configuration menu
    Copy the full SHA
    1c34610 View commit details
    Browse the repository at this point in the history