Skip to content

Commit 7432f93

Browse files
committed
bugfix: Subscription manager breaks on PersistentConnectionClosedOK
1 parent a08787d commit 7432f93

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

web3/providers/persistent/async_ipc.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ async def socket_recv(self) -> RPCResponse:
110110
raise
111111

112112
if not data:
113-
raise PersistentConnectionClosedOK("Socket reader received end of stream.")
113+
raise PersistentConnectionClosedOK(
114+
user_message="Socket reader received end of stream."
115+
)
114116
return self.decode_rpc_response(data)
115117

116118
# -- private methods -- #

web3/providers/persistent/subscription_manager.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ async def handle_subscriptions(self, run_forever: bool = False) -> None:
298298
"Message listener background task for the provider has stopped "
299299
"unexpectedly. Stopping subscription handling."
300300
)
301+
break
301302

302303
# no active handler subscriptions, clear the handler subscription queue
303304
self._provider._request_processor._reset_handler_subscription_queue()

0 commit comments

Comments
 (0)