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

Fix a deadlock in Session.Close() during control connection reconnect #1688

Merged
merged 1 commit into from
Apr 11, 2023

Commits on Apr 11, 2023

  1. Fix a deadlock in Session.Close() during control connection reconnect

    We switched from separate mutex for closing to sessionStateMu in
    312a614.
    This change introduced a deadlock.
    
    We don't need to hold the mutex for the whole duration of Close(),
    we only need to update the status atomically.
    Previously IsClosed() returned true only after all closing is done
    (because of the deferred unlock).
    We can emulate that by setting isClosed at the end of Close().
    We need a new variable to ensure that Close() is only executed once.
    
    Fixes gocql#1687
    martin-sucha committed Apr 11, 2023
    Configuration menu
    Copy the full SHA
    b8c4e16 View commit details
    Browse the repository at this point in the history