lib/protocol: Revert unreleased changes related to closing connections #5688
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As brought up by @calmh in the most recent PR (#5685) in a string of PRs related to handling closing of protocol connections, the way I introduced these changes wasn't particularly trust inspiring and the affected code is critical.
There were three involved changes, with follow-up fixes each:
*model.Closed
(fixes cluster config panic panic: bug: ClusterConfig called on closed or nonexistent connection #4170): lib/model, lib/protocol: Wait for reader/writer loops on close (fixes #4170) #5657 -> lib/protocol: Fix yet another deadlock (fixes #5678) #5679 (unmerged: lib/protocol: Fix deadlock on sending close message #5685)My proposal for the next RC is to revert these changes (0229f04) and redo one unrelated change (337ae59). This brings us back to a state, that has been in place for a long time. There are known problems, but we were able to live with them for a long time, so we can again. I do intend to tackle this problems again for the next RC cycle. If you agree, I'll PR both commits separately, as I believe it makes for a cleaner history.