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

Acquire per_peer_state write lock earlier in ChannelManager::write #2998

Merged

Commits on Apr 17, 2024

  1. Acquire per_peer_state write lock earlier in ChannelManager::write

    Previously, we would hold the `per_peer_state` `read` lock during the
    serialization of channel objects. While this might have reduced lock
    congestion minimally, we also calculated the number of serializable
    peers in this phase, only to use it later after dropping and reacquiring
    the `per_peer_state` `write` lock.
    
    This could potentially result in inconsistiencies if the
    `serializable_peer_count` would change after we dropped the `read` lock
    but before we acquired the `write` lock.
    
    To mitigate the issue we just acquire the `write` lock ealier and hold
    it for the remainder of `ChannelManager::write`.
    tnull committed Apr 17, 2024
    Configuration menu
    Copy the full SHA
    ce36f2c View commit details
    Browse the repository at this point in the history