GRI-2149: stop resetting the reconnect backoff on a pending hello #286
No reviewers
Labels
No labels
Area/Backend
Area/Database
Area/Docs
Area/Frontend
Area/Infra
Area/Security
Area/Tests
Area/Tooling
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Lang/Python
Lang/Rust
Lang/Shell
Lang/SQL
Lang/TypeScript
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Routing
Auto
Routing
Hold
Routing
Human
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Grimoirix/grimoire-of-digital-signage!286
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/GRI-2149-backoff-reset-on-pending"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #285.
Cause
Sync::connect_oncehard-codedadmitted: trueon every ordinary close(
Noneframe,Message::Close), regardless of whether the server actuallyaccepted the device during that connection. A pending hello answers the
handshake too, so a device waiting for admin approval reset its backoff to
BACKOFF_BASE(1 s) on every reconnect and never backed off.Fix
Sessionnow tracksadmitteditself: true onceHelloOutcome::Acceptedisseen, or once an
EnrolmentUpdate::Approvedarrives mid-connection (anapproval that lands while the device is still on a pending connection).
Sync::connect_oncereadssession.is_admitted()instead of hard-codingtrue, so a still-pending device's backoff keeps growing betweenreconnects.
Tests
Added to
crates/client/src/session.rs:a_pending_hello_does_not_admit_the_devicean_accepted_hello_admits_the_devicean_approval_during_a_pending_connection_admits_the_deviceRan:
cargo test -p client(98 unit tests + 3 integration tests, all pass),cargo clippy -p client --all-targets(clean),scripts/local-gates.sh --rust-only(every gate passed).
Reviewed: cause and fix match the issue, tests cover it, CI green, up to date with dev.