Commit c971de0
[FIXED] Nil account panic in processLeafNodeConnect
When a leafnode connection is closed during authentication (e.g. auth
timeout), the account may not have been set on the client yet. If
processLeafNodeConnect continues to run after the connection was
closed, it dereferences c.acc in registerLeafNodeCluster, causing a
nil pointer panic.
Add a nil check for the account before proceeding, consistent with
other code paths in the same file (initLeafNodeSmapAndSendSubs,
checkJetStreamExportReconcile) that already guard against this.
Add a test that races a CONNECT with an expired auth timeout to
exercise the guard.
Resolves #7989
Signed-off-by: umut-polat <52835619+umut-polat@users.noreply.github.com>1 parent 6556b92 commit c971de0
2 files changed
Lines changed: 55 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2158 | 2158 | | |
2159 | 2159 | | |
2160 | 2160 | | |
| 2161 | + | |
| 2162 | + | |
| 2163 | + | |
| 2164 | + | |
| 2165 | + | |
| 2166 | + | |
| 2167 | + | |
2161 | 2168 | | |
2162 | 2169 | | |
2163 | 2170 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12160 | 12160 | | |
12161 | 12161 | | |
12162 | 12162 | | |
| 12163 | + | |
| 12164 | + | |
| 12165 | + | |
| 12166 | + | |
| 12167 | + | |
| 12168 | + | |
| 12169 | + | |
| 12170 | + | |
| 12171 | + | |
| 12172 | + | |
| 12173 | + | |
| 12174 | + | |
| 12175 | + | |
| 12176 | + | |
| 12177 | + | |
| 12178 | + | |
| 12179 | + | |
| 12180 | + | |
| 12181 | + | |
| 12182 | + | |
| 12183 | + | |
| 12184 | + | |
| 12185 | + | |
| 12186 | + | |
| 12187 | + | |
| 12188 | + | |
| 12189 | + | |
| 12190 | + | |
| 12191 | + | |
| 12192 | + | |
| 12193 | + | |
| 12194 | + | |
| 12195 | + | |
| 12196 | + | |
| 12197 | + | |
| 12198 | + | |
| 12199 | + | |
| 12200 | + | |
| 12201 | + | |
| 12202 | + | |
| 12203 | + | |
| 12204 | + | |
| 12205 | + | |
| 12206 | + | |
| 12207 | + | |
| 12208 | + | |
| 12209 | + | |
| 12210 | + | |
0 commit comments