fix(server): harden COTP connection framing - #893
gijzelaerr wants to merge 2 commits into
Conversation
|
@esternu Could you rerun the two pure-Python compatibility reproducers from #889 and #890 against commit c998860? This PR changes the COTP connection-confirmation framing and fragmented/coalesced request handling specifically around those failures. No physical PLC is needed; a pass or remaining traceback from both reproducers would close the validation loop. |
|
Thanks for the quick fix! I reran both against c998860 - both pass. Setup: pure-Python server from the PR checkout, no PLC. Two clients: Telegraf 1.30.3
One edge case you may want to look at - not a blocker for #889/#890. A request split into two COTP fragments, with a gap longer than started = False
while True:
header_deadline = time.monotonic() + self.RECEIVE_DEADLINE
try:
tpkt_header = self._recv_exact(4, header_deadline)
except TimeoutError as e:
if started:
raise S7ConnectionError("Receive deadline exceeded between COTP fragments") from e
raise
started = TrueAbout your comments on #889 and #890 asking for PRs: since #893 already covers both, I don't want to open duplicates. I do have fixes for both on my fork - |
Co-authored-by: Codex <noreply@openai.com>
|
Thanks for the detailed validation and reproducer. I added the between-fragments timeout handling and a regression test in 363374c, and merged current master into this branch. The PR is conflict-free and all checks are green. |
Summary
Verification
uv run pytest— 2076 passed, 82 skippeduv run pre-commit run --all-filesuv buildCloses #889
Closes #890