Commit 6dd9673
committed
fix: prevent duplicate reconnect tasks and socket leaks on auth failure
_trigger_reconnect now sets _reconnecting=True before scheduling the
task, so two failures in the same event loop tick can't both spawn
reconnect tasks. The redundant guard inside _reconnect is removed.
_open_connection now closes the socket on any handshake failure (not
just wrong response type), preventing leaked connections from recv()
or json.loads() errors.1 parent 43d059d commit 6dd9673
1 file changed
Lines changed: 23 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
130 | 139 | | |
131 | | - | |
132 | | - | |
133 | | - | |
| 140 | + | |
134 | 141 | | |
135 | 142 | | |
136 | 143 | | |
| |||
159 | 166 | | |
160 | 167 | | |
161 | 168 | | |
| 169 | + | |
162 | 170 | | |
163 | 171 | | |
164 | 172 | | |
| |||
209 | 217 | | |
210 | 218 | | |
211 | 219 | | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | 220 | | |
216 | 221 | | |
217 | 222 | | |
| |||
0 commit comments