mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-02-22 22:23:52 +08:00
IsoTpParallelQuery: set timed out requests done (#27764)
* better ordering and comments * remove * mark done if timed out * response_timeouts should be only for extending timeouts, not marking done * so the print still works * more clear comment * that can be removed
This commit is contained in:
@@ -133,19 +133,19 @@ class IsoTpParallelQuery:
|
||||
response_timeouts[tx_addr] = time.monotonic() + self.response_pending_timeout
|
||||
cloudlog.error(f"iso-tp query response pending: {tx_addr}")
|
||||
else:
|
||||
response_timeouts[tx_addr] = 0
|
||||
request_done[tx_addr] = True
|
||||
cloudlog.error(f"iso-tp query bad response: {tx_addr} - 0x{dat.hex()}")
|
||||
|
||||
# Break if all requests are done, we've timed out on all requests, or we've hit a max total timeout
|
||||
if all(request_done.values()):
|
||||
break
|
||||
|
||||
# Mark request done if address timed out
|
||||
cur_time = time.monotonic()
|
||||
if cur_time - max(response_timeouts.values()) > 0:
|
||||
for tx_addr in msgs:
|
||||
for tx_addr in response_timeouts:
|
||||
if cur_time - response_timeouts[tx_addr] > 0:
|
||||
if request_counter[tx_addr] > 0 and not request_done[tx_addr]:
|
||||
cloudlog.error(f"iso-tp query timeout after receiving response: {tx_addr}")
|
||||
request_done[tx_addr] = True
|
||||
|
||||
# Break if all requests are done (finished or timed out)
|
||||
if all(request_done.values()):
|
||||
break
|
||||
|
||||
if cur_time - start_time > total_timeout:
|
||||
|
||||
Reference in New Issue
Block a user