Make every synchronous probe-send path transactional, including the blocking
client, threaded singleton client, and legacy managed group.
Transaction boundary
Probe encoding, stale/collision checks, pending reservation, counter/deadline
arithmetic, schedule preflight, and event capacity reservation occur before the
UDP send. Successful kernel acceptance is followed immediately by infallible
SessionMachine and ProbeSchedule commits.
Presentation timing, datagram-length validation, and event construction occur
only after both authoritative commits.
Failure behavior
Socket failures leave machine and schedule state unchanged. Stale preparations,
sequence collisions, allocation failures, and arithmetic overflows are rejected
before send. Successful short sends commit both states before returning
DatagramLengthMismatch.
Public errors
PendingSequenceCollision
AllocationFailed
StalePreparedProbe
DatagramLengthMismatch
All transaction and commit token types remain crate-private.
Testing
Adds focused coverage for pending preflight, allocation mapping, stale
preparations, dropped preparations, counter/deadline overflow, sequence
wrapping, infallible commit behavior, blocking and managed send failures,
successful short sends, shared timestamps, and managed pacing preservation.
The workspace, no-default-feature suite, formatting, Clippy, diff checks, and
independent per-commit verification all pass.
## Summary
Make every synchronous probe-send path transactional, including the blocking
client, threaded singleton client, and legacy managed group.
## Transaction boundary
Probe encoding, stale/collision checks, pending reservation, counter/deadline
arithmetic, schedule preflight, and event capacity reservation occur before the
UDP send. Successful kernel acceptance is followed immediately by infallible
SessionMachine and ProbeSchedule commits.
Presentation timing, datagram-length validation, and event construction occur
only after both authoritative commits.
## Failure behavior
Socket failures leave machine and schedule state unchanged. Stale preparations,
sequence collisions, allocation failures, and arithmetic overflows are rejected
before send. Successful short sends commit both states before returning
DatagramLengthMismatch.
## Public errors
- PendingSequenceCollision
- AllocationFailed
- StalePreparedProbe
- DatagramLengthMismatch
All transaction and commit token types remain crate-private.
## Testing
Adds focused coverage for pending preflight, allocation mapping, stale
preparations, dropped preparations, counter/deadline overflow, sequence
wrapping, infallible commit behavior, blocking and managed send failures,
successful short sends, shared timestamps, and managed pacing preservation.
The workspace, no-default-feature suite, formatting, Clippy, diff checks, and
independent per-commit verification all pass.
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
### 💡 Codex Review
Here are some automated review suggestions for this pull request.
**Reviewed commit:** `9bc2ac90b3`
<details> <summary>ℹ️ About Codex in GitHub</summary>
<br/>
[Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
</details>
When packet encoding, HMAC calculation, allocation, or scheduler preemption delays this preflight, sent_at and the derived timeout_at precede the actual kernel send by the entire delay. This inflates RTT/client-to-server timing and can make a successfully sent probe expire immediately with a short probe_timeout; previously production code sampled the timestamp inside the send closure immediately before socket.send. Keep any early timestamp needed for schedule permission separate from the committed send timestamp, and apply the same correction to send_echo_to_locked_target_at.
Useful? React with 👍 / 👎.
**<sub><sub></sub></sub> Timestamp probes immediately before sending**
When packet encoding, HMAC calculation, allocation, or scheduler preemption delays this preflight, `sent_at` and the derived `timeout_at` precede the actual kernel send by the entire delay. This inflates RTT/client-to-server timing and can make a successfully sent probe expire immediately with a short `probe_timeout`; previously production code sampled the timestamp inside the send closure immediately before `socket.send`. Keep any early timestamp needed for schedule permission separate from the committed send timestamp, and apply the same correction to `send_echo_to_locked_target_at`.
Useful? React with 👍 / 👎.
On every successful probe, send_call is now sampled only after commit_probe_sent and the schedule commit, so the public metric documented as time spent in the socket send call also includes hash-map insertion and history cleanup; when a wrapped sequence removes retained timeout/completion history, that cleanup can scan the configured tracking window and materially distort the aggregated send-call statistics. Capture the elapsed duration immediately after socket.send, as the previous implementation did, and make the analogous change in the managed-group send path.
Useful? React with 👍 / 👎.
**<sub><sub></sub></sub> Stop the send timer before committing state**
On every successful probe, `send_call` is now sampled only after `commit_probe_sent` and the schedule commit, so the public metric documented as time spent in the socket send call also includes hash-map insertion and history cleanup; when a wrapped sequence removes retained timeout/completion history, that cleanup can scan the configured tracking window and materially distort the aggregated send-call statistics. Capture the elapsed duration immediately after `socket.send`, as the previous implementation did, and make the analogous change in the managed-group send path.
Useful? React with 👍 / 👎.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Make every synchronous probe-send path transactional, including the blocking
client, threaded singleton client, and legacy managed group.
Transaction boundary
Probe encoding, stale/collision checks, pending reservation, counter/deadline
arithmetic, schedule preflight, and event capacity reservation occur before the
UDP send. Successful kernel acceptance is followed immediately by infallible
SessionMachine and ProbeSchedule commits.
Presentation timing, datagram-length validation, and event construction occur
only after both authoritative commits.
Failure behavior
Socket failures leave machine and schedule state unchanged. Stale preparations,
sequence collisions, allocation failures, and arithmetic overflows are rejected
before send. Successful short sends commit both states before returning
DatagramLengthMismatch.
Public errors
All transaction and commit token types remain crate-private.
Testing
Adds focused coverage for pending preflight, allocation mapping, stale
preparations, dropped preparations, counter/deadline overflow, sequence
wrapping, infallible commit behavior, blocking and managed send failures,
successful short sends, shared timestamps, and managed pacing preservation.
The workspace, no-default-feature suite, formatting, Clippy, diff checks, and
independent per-commit verification all pass.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
9bc2ac90b3ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
@@ -348,0 +398,4 @@}pub(crate) fn echo_sent_event(remote: SocketAddr,When packet encoding, HMAC calculation, allocation, or scheduler preemption delays this preflight,
sent_atand the derivedtimeout_atprecede the actual kernel send by the entire delay. This inflates RTT/client-to-server timing and can make a successfully sent probe expire immediately with a shortprobe_timeout; previously production code sampled the timestamp inside the send closure immediately beforesocket.send. Keep any early timestamp needed for schedule permission separate from the committed send timestamp, and apply the same correction tosend_echo_to_locked_target_at.Useful? React with 👍 / 👎.
On every successful probe,
send_callis now sampled only aftercommit_probe_sentand the schedule commit, so the public metric documented as time spent in the socket send call also includes hash-map insertion and history cleanup; when a wrapped sequence removes retained timeout/completion history, that cleanup can scan the configured tracking window and materially distort the aggregated send-call statistics. Capture the elapsed duration immediately aftersocket.send, as the previous implementation did, and make the analogous change in the managed-group send path.Useful? React with 👍 / 👎.