Skip to content

Commit 413fa51

Browse files
caspervonbksenia-vazhdaevawallyqs
authored
Fix EOF processing while client is connecting (#775)
Signed-off-by: Ksenia Vazhdaeva <[email protected]> Co-authored-by: Ksenia Vazhdaeva <[email protected]> Co-authored-by: Waldemar Quevedo <[email protected]>
1 parent 041b439 commit 413fa51

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

nats/src/nats/aio/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1406,10 +1406,10 @@ async def _process_op_err(self, e: Exception) -> None:
14061406
try to switch the server to which it is currently connected
14071407
otherwise it will disconnect.
14081408
"""
1409-
if self.is_connecting or self.is_closed or self.is_reconnecting:
1409+
if self.is_closed or self.is_reconnecting:
14101410
return
14111411

1412-
if self.options["allow_reconnect"] and self.is_connected:
1412+
if self.options["allow_reconnect"] and (self.is_connected or self.is_connecting):
14131413
self._status = Client.RECONNECTING
14141414
self._ps.reset()
14151415

@@ -2073,7 +2073,7 @@ async def _read_loop(self) -> None:
20732073
should_bail = self.is_closed or self.is_reconnecting
20742074
if should_bail or self._transport is None:
20752075
break
2076-
if self.is_connected and self._transport.at_eof():
2076+
if self._transport.at_eof():
20772077
err = errors.UnexpectedEOF()
20782078
await self._error_cb(err)
20792079
await self._process_op_err(err)

0 commit comments

Comments
 (0)