Commit 60f9347
committed
OF-3155: Fix race condition in resource conflict resolution
The logic that handles resource conflicts closed the old session asynchronously while allowing the new session to be marked as bound immediately. This could cause the new session to be affected by cleanup intended for the old session, such as receiving the old session's unavailable presence. Internal state could also become inconsistent.
This update introduces a temporary wait mechanism that delays promotion of the new session until the old session has fully closed. A busy-wait loop is used as a stopgap, as connectionClosed event listeners are not reliable in clustered deployments and do not guarantee that all listeners have completed execution.
This prevents the new session from being influenced by asynchronous cleanup of the old session and avoids related routing and presence issues.
(cherry picked from commit 50be000)1 parent b909e18 commit 60f9347
1 file changed
Lines changed: 12 additions & 0 deletions
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
39 | 42 | | |
40 | 43 | | |
41 | 44 | | |
| |||
151 | 154 | | |
152 | 155 | | |
153 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
154 | 166 | | |
155 | 167 | | |
156 | 168 | | |
| |||
0 commit comments