Skip to content

Commit 3c32cf4

Browse files
committed
fix: auth handler hanging until timeout if errored
1 parent bab45e9 commit 3c32cf4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/nodes/NodeConnectionManager.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1770,18 +1770,18 @@ class NodeConnectionManager {
17701770
'Expected success message but got authentication message',
17711771
);
17721772
}
1773+
await writer.close();
1774+
await reader.cancel();
17731775
});
1774-
// Gracefully close the connection if there was no error
1775-
await writer?.close();
1776-
await reader?.cancel();
17771776
connectionsEntry.authenticatedForward = AuthenticatingState.SUCCESS;
17781777
} catch (e) {
17791778
const err = new nodesErrors.ErrorNodeManagerAuthenticationFailed(
17801779
undefined,
17811780
{ cause: e },
17821781
);
1783-
await writer?.abort(err);
1784-
await reader?.cancel(err);
1782+
// We only care if the reader and writer closed properly
1783+
await writer?.abort(err).catch(() => {});
1784+
await reader?.cancel(err).catch(() => {});
17851785
// Make sure any pending authentication is set to FAIL accordingly
17861786
if (
17871787
connectionsEntry.authenticatedForward === AuthenticatingState.PENDING

0 commit comments

Comments
 (0)