Add opt-in HVR-only peer cleanup - #77
Open
Jason-Morcos wants to merge 2 commits into
Open
Conversation
Jason-Morcos
force-pushed
the
codex/hvr-peer-cleanup
branch
from
August 31, 2026 22:29
aac8b8e to
92ec459
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the second half of #75.
Why
On both WD53 appliances in my local setup, an unsuccessful initial certificate
handshake can stop after HelloVerifyRequest. The appliance retains that
half-open IoTivity peer on the client UDP tuple, and an immediate clean retry
can remain silent even though the endpoint is otherwise healthy.
The working recovery path sends the standard epoch-zero fatal
handshake_failurealert for that exact incomplete peer, waits outside thetransport, and then retries from the same fixed source port. This PR adds the
transport half only; the package does not choose the retry delay or perform a
retry.
What changes
connect(cleanup_hvr_peer=True)for sessions using an actualSamsungServerProfileand a fixed non-zerolocal_port;header, never handshake payloads;
HelloVerifyRequest messages;
transcripts without sending an alert;
and
HandshakePeerCleanupError, aSessionTimeoutErrorsubclass, onlywhen the complete alert datagram was handed to the UDP socket.
An ordinary timeout remains
SessionTimeoutError. Cancellation, OpenSSLfailure, socket I/O failure, an inexact transcript, or cleanup-send failure do
not enter the caller's cleanup/retry path.
Validation
ordering, metadata bounds, malformed and mixed records, cancellation, send
failure, provider/port preconditions, and no automatic retry
Merge order
This is stacked on #76 and currently includes that commit in the GitHub diff.
Please merge #76 first; this PR then reduces to commit
92ec459. #74 remainsindependent. The final PY-18 API/documentation PR will stack on this one.