From ce6985ca3f4396b50b14de8477f758e82b573c8d Mon Sep 17 00:00:00 2001 From: Marc Billow Date: Sun, 5 Jul 2026 16:51:44 -0500 Subject: [PATCH] fix: restore Block2 retry debug logging dropped during port MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task 8's port of retry/retransmit from localthings dropped the per-attempt timeout/retry log lines (present in coap_dtls.py) — found while gathering real-device pacing evidence, where the missing logs made retry frequency impossible to see. Restores both the retry and final-timeout log lines. --- protocol/dtls_session.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/protocol/dtls_session.py b/protocol/dtls_session.py index 157c295..014f242 100644 --- a/protocol/dtls_session.py +++ b/protocol/dtls_session.py @@ -448,8 +448,17 @@ class DtlsCoapSession: break # got a response remaining = deadline - time.time() if remaining <= 0 or attempt == _BLOCK_MAX_ATTEMPTS - 1: + logger.debug( + "GET %s /%s block %d: timed out after %d attempt(s)", + self.host, '/'.join(path_segs), num, attempt + 1, + ) raise TimeoutError( f"GET /{'/'.join(path_segs)} block {num} timeout") + logger.debug( + "GET %s /%s block %d: attempt %d/%d timeout, retrying", + self.host, '/'.join(path_segs), num, + attempt + 1, _BLOCK_MAX_ATTEMPTS, + ) finally: self._pending.pop(tok, None) if 'err' in container: