Repository navigation
fix(proto): drop handshake keys when path 0 was already discarded - #6
Merged
Merged
Conversation
`discard_space` expected path 0 to exist when it drops the Initial or Handshake keys. Path 0 can be abandoned and discarded before the handshake is confirmed: a replacement path took over, or the peer sent PATH_ABANDON for it. The `expect` then panicked, the panic poisoned the connection mutex, and a later `Drop` that locked it panicked again inside cleanup, which aborted the process (n0-computer#904). Now `discard_space` still drops the keys and the sent packets, and skips only the in-flight and loss-timer update of the discarded path. A discarded path 0 also keeps its Initial and Handshake number spaces until those are dropped, so a late ACK in them reached `path_data` for a path that no longer exists, and panicked the same way. Such an ACK is now ignored, as an ACK on any other discarded path is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CommaBot
pushed a commit
to AFK-surf/monoid
that referenced
this pull request
Nov 26, 2026
…front The front on mm2 aborted on 2026-11-26 at 10:23:20 UTC after about 3 days up, and every device connection to it dropped. noq-proto's `discard_space` expected path 0 to exist when it dropped the Handshake keys. Path 0 can be abandoned and discarded before the handshake is confirmed, so the `expect` panicked. The panic poisoned the connection mutex, and a `Drop` that locked it panicked again in cleanup, which aborted the process (n0-computer/noq#904). zzj3720/noq#6 (ec345e7) fixes `discard_space`, and also ignores a late Initial or Handshake ACK on a discarded path 0, which panicked the same way in `path_data`. The front's STREAMS stays at 8. A bump would restart every station's front once, and drop every device, to fix a crash seen once in 3 days. A front starts from the new release whenever it starts next. Changelog: 修复:station 的网络前端在多路径握手时偶发崩溃、所有设备一起断线的问题 Changelog-parts: station, android, desktop Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CommaBot
pushed a commit
to AFK-surf/monoid
that referenced
this pull request
Nov 26, 2026
…front The front on mm2 aborted on 2026-11-26 at 10:23:20 UTC after about 3 days up, and every device connection to it dropped. noq-proto's `discard_space` expected path 0 to exist when it dropped the Handshake keys. Path 0 can be abandoned and discarded before the handshake is confirmed, so the `expect` panicked. The panic poisoned the connection mutex, and a `Drop` that locked it panicked again in cleanup, which aborted the process (n0-computer/noq#904). zzj3720/noq#6 (ec345e7) fixes `discard_space`, and also ignores a late Initial or Handshake ACK on a discarded path 0, which panicked the same way in `path_data`. The front's STREAMS stays at 8. A bump would restart every station's front once, and drop every device, to fix a crash seen once in 3 days. A front starts from the new release whenever it starts next. Changelog: 修复:station 的网络前端在多路径握手时偶发崩溃、所有设备一起断线的问题 Changelog-parts: station, android, desktop Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CommaBot
added a commit
to AFK-surf/monoid
that referenced
this pull request
Nov 26, 2026
…front (#8847) The front on mm2 aborted on 2026-11-26 at 10:23:20 UTC after about 3 days up, and every device connection to it dropped. noq-proto's `discard_space` expected path 0 to exist when it dropped the Handshake keys. Path 0 can be abandoned and discarded before the handshake is confirmed, so the `expect` panicked. The panic poisoned the connection mutex, and a `Drop` that locked it panicked again in cleanup, which aborted the process (n0-computer/noq#904). zzj3720/noq#6 (ec345e7) fixes `discard_space`, and also ignores a late Initial or Handshake ACK on a discarded path 0, which panicked the same way in `path_data`. The front's STREAMS stays at 8. A bump would restart every station's front once, and drop every device, to fix a crash seen once in 3 days. A front starts from the new release whenever it starts next. Changelog: 修复:station 的网络前端在多路径握手时偶发崩溃、所有设备一起断线的问题 Changelog-parts: station, android, desktop Co-authored-by: 3720 <zuozijian1994@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
On 2026-11-26 10:23:20 UTC, the still.fail mesh front on the
mm2station aborted with signal 6:The front had run for about 3 days. Every device connection to that station dropped. Upstream has the same report and no fix yet: n0-computer#904.
discard_spaceexpects path 0 to exist when it drops the Initial or Handshake keys. Path 0 can be abandoned and discarded before the handshake is confirmed: a replacement path took over (this fork also abandons an idle last-open path once a replacement validates,4b0448dd), or the peer sent PATH_ABANDON for it.Change
discard_space: if path 0 is gone, still drop the keys and the sent packets. Skip only the in-flight and loss-timer update of the discarded path (PathDrainedalready stopped its timers).inner_on_ack_received: a discarded path 0 keeps its Initial and Handshake number spaces until those are dropped. A late ACK in them reachedpath_data(PathId::ZERO)and panicked the same way. Such an ACK is now ignored, as an ACK on any other discarded path is.#[cfg(test)]) let the test drive the exact state: path 0 abandoned and discarded while the client still holds its Handshake keys.Tests
tests::multipath::handshake_keys_dropped_after_path_zero_discarded.discard_spacefix reverted, it panics withPathId::ZERO is alive while Initial/Handshake spaces exist.unknown path: 0.cargo test -p noq-proto --lib: 443 passed.cargo clippy -p noq-proto --all-targetsadds no warnings.cargo fmt --checkreports nothing in the changed lines.Model: Claude Opus 5.5. Test framework: cargo test.
🤖 Generated with Claude Code