Page MenuHomePhabricator

[Tunnelbroker] Refactor connection lifetimes into session object
ClosedPublic

Authored by jon on May 12 2023, 2:32 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 12, 8:59 AM
Unknown Object (File)
Tue, Apr 9, 5:59 AM
Unknown Object (File)
Sat, Apr 6, 6:33 PM
Unknown Object (File)
Feb 11 2024, 9:55 AM
Unknown Object (File)
Feb 10 2024, 8:23 AM
Unknown Object (File)
Feb 10 2024, 8:22 AM
Unknown Object (File)
Feb 10 2024, 8:22 AM
Unknown Object (File)
Feb 10 2024, 8:13 AM
Subscribers

Details

Summary

For better encapsulation around connection events
(e.g. device being authenticated and identified), moved
more of the connection logic into the session object.

Also, refine how connections are handled so they are properly
deregistered once a client closes a connection.

Depends on D7799

Test Plan
nix develop

# init localstack and run terraform
comm-dev services start
(cd services/terraform && ./run.sh)

(cd services/tunnelbroker && cargo run &)
(cd services/commtest && cargo test --test tunnelbroker_integration_test)
# Previously, running the suite twice would fail
(cd services/commtest && cargo test --test tunnelbroker_integration_test)

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

services/tunnelbroker/src/websockets/session.rs
108 ↗(On Diff #26422)

These unwraps get handled in the next diff.

Just a lot of boilerplate to handle this nicely.

This revision is now accepted and ready to land.May 30 2023, 6:30 AM

Rebase on previous changes