fix: prevent connection hang when Login7 response is interrupted#1736
fix: prevent connection hang when Login7 response is interrupted#1736arthurschreiber wants to merge 1 commit into
Conversation
`performSentLogin7WithStandardLogin` awaited the token stream parser's `end` event without racing it against the abort signal, unlike the NTLM, federated authentication, and initial SQL login paths. If the socket errored, half-closed, or stalled after the first packet of the login response but before the response message was complete, the parser would never emit `end`. The abort signal (from a socket failure or the connect timeout) had no effect at that point, so `connect()` would never invoke its callback and the connection would hang forever. Race the parser's `end` event against the abort signal, matching the other login paths. The federated authentication flow also benefits, as it delegates to this method after sending the federated authentication token.
Code ReviewOverviewThis PR fixes a genuine connection hang bug in Production Code (
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1736 +/- ##
==========================================
+ Coverage 78.82% 79.66% +0.83%
==========================================
Files 90 90
Lines 4892 4892
Branches 922 922
==========================================
+ Hits 3856 3897 +41
+ Misses 737 692 -45
- Partials 299 303 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
performSentLogin7WithStandardLoginawaited the token stream parser'sendevent without racing it against the abort signal, unlike the NTLM, federated authentication, and initial SQL login paths. If the socket errored, half-closed, or stalled after the first packet of the login response but before the response message was complete, the parser would never emitend. The abort signal (from a socket failure or the connect timeout) had no effect at that point, soconnect()would never invoke its callback and the connection would hang forever.Race the parser's
endevent against the abort signal, matching the other login paths. The federated authentication flow also benefits, as it delegates to this method after sending the federated authentication token.