File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -1090,11 +1090,17 @@ async def _do_ensure_connected[HandshakeMetadata](
10901090 get_current_time () + transport_options .handshake_timeout_ms / 1000
10911091 )
10921092
1093- while rate_limiter .has_budget (client_id ):
1093+ while (
1094+ rate_limiter .has_budget (client_id )
1095+ and get_current_time () < handshake_deadline_ms
1096+ ):
10941097 if (state := get_state ()) in TerminalStates or state in ActiveStates :
10951098 logger .info (f"_do_ensure_connected stopping due to state={ state } " )
10961099 break
10971100
1101+ if (task := asyncio .current_task ()) and task .cancelled ():
1102+ break
1103+
10981104 if attempt_count > 0 :
10991105 logger .info (f"Retrying build handshake number { attempt_count } times" )
11001106 attempt_count += 1
You can’t perform that action at this time.
0 commit comments