Skip to content

Conversation

jrick
Copy link
Owner

@jrick jrick commented Jan 3, 2025

There was still a double finalization race, detected by the panic introduced by the previous commit. If setErr() is called during client teardown, all currently managed calls will be errored and finalized, and the calls map set to nil.

Unfortunately, Client.Go was again finalizing the call even after setErr released the calls mutex, because it had a another variable pointing to it.

To fix this race, look up the call entry in the map and only finalize and delete it when it present.

There was still a double finalization race, detected by the panic introduced
by the previous commit.  If setErr() is called during client teardown, all
currently managed calls will be errored and finalized, and the calls map set
to nil.

Unfortunately, Client.Go was again finalizing the call even after setErr
released the calls mutex, because it had a another variable pointing to it.

To fix this race, look up the call entry in the map and only finalize and
delete it when it present.
@jrick jrick merged commit eec147d into master Jan 3, 2025
@jrick jrick deleted the more-races branch January 3, 2025 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants