mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-11 04:12:07 +08:00
IsoTpParallelQuery: log all timeouts (#28325)
* log * self explan * clean up * revert * need a better name * move * bvack old-commit-hash: 026c093d05dfc05a9a04ff341942e5b9858a12f7
This commit is contained in:
@@ -97,6 +97,7 @@ class IsoTpParallelQuery:
|
||||
|
||||
results = {}
|
||||
start_time = time.monotonic()
|
||||
addrs_responded = set() # track addresses that have ever sent a valid iso-tp frame for timeout logging
|
||||
response_timeouts = {tx_addr: start_time + timeout for tx_addr in self.msg_addrs}
|
||||
while True:
|
||||
self.rx()
|
||||
@@ -111,6 +112,7 @@ class IsoTpParallelQuery:
|
||||
|
||||
# Extend timeout for each consecutive ISO-TP frame to avoid timing out on long responses
|
||||
if rx_in_progress:
|
||||
addrs_responded.add(tx_addr)
|
||||
response_timeouts[tx_addr] = time.monotonic() + timeout
|
||||
|
||||
if not dat:
|
||||
@@ -141,8 +143,13 @@ class IsoTpParallelQuery:
|
||||
cur_time = time.monotonic()
|
||||
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}")
|
||||
if not request_done[tx_addr]:
|
||||
if request_counter[tx_addr] > 0:
|
||||
cloudlog.error(f"iso-tp query timeout after receiving partial response: {tx_addr}")
|
||||
elif tx_addr in addrs_responded:
|
||||
cloudlog.error(f"iso-tp query timeout while receiving response: {tx_addr}")
|
||||
else:
|
||||
cloudlog.error(f"iso-tp query timeout with no response: {tx_addr}")
|
||||
request_done[tx_addr] = True
|
||||
|
||||
# Break if all requests are done (finished or timed out)
|
||||
|
||||
Reference in New Issue
Block a user