This repository has been archived by the owner on Aug 26, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 apache#1687
- Loading branch information