-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for re-using CASE sessions #17266
Conversation
PR #17266: Size comparison from 97b144a to df6dacd Increases (14 builds for cc13x2_26x2, cyw30739, efr32, esp32, linux, nrfconnect, p6, telink)
Decreases (8 builds for cyw30739, efr32, k32w, mbed, p6)
Full report (22 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
|
b8361bd
to
8965367
Compare
PR #17266: Size comparison from 964adbc to 8965367 Increases (24 builds for cc13x2_26x2, cyw30739, efr32, esp32, linux, nrfconnect, p6, telink)
Decreases (10 builds for cc13x2_26x2, cyw30739, efr32, k32w, mbed, p6)
Full report (32 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, I pulled your branch and verified that base case of OTA is working well
Chatted with Boris, he's out today. Will merge, and if he has any issues, he'll follow-up next week with issues.
} | ||
|
||
// | ||
// Do not touch this instance anymore; it might have been destroyed by a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"device", not "this": this is a static method.
@@ -144,6 +144,16 @@ class DLL_EXPORT DeviceController : public SessionRecoveryDelegate, public Abstr | |||
*/ | |||
virtual CHIP_ERROR Shutdown(); | |||
|
|||
SessionManager * SessionMgr() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should strongly consider removing this and changing the one consumer we have (chip-tool) to get the system state from the device controller factory and get the session manager from there...
Failing that, a name that more clearly indicates that null can be returned (e.g. GetSessionMgr), or a signature that can fail, would be good...
Problem
CASE sessions that were setup as a side-effect of a node acting as a responder (i.e sessions setup by
CASEServer
) were not getting re-used correctly by client-side logic (i.eCASEClient
), see #15986.This was further exacerbated by calls to expire all sessions upon completion of CASE session establishment, which meant a continuous ping-pong effect of a previously established session being destroyed upon establishment of a new session on each side, but would tear down the wrong one on the other.
Change Overview
SessionManager
is the source of truth for all active sessions, so extended the existingFindSecureSessionForNode
to take a session type as an argument to ensure we only find active CASE sessions, and calling this fromOperationalDeviceProxy
.Other changes include:
DequeueConnectionCallback
variants for failure and success into a single method that does both since it was always mutually exclusive.Connect
by always just enqueuing, and then dequeuing based on failure/success.SetConnectedSession
method that should never have be a public API, and fixing the tv-app (which is the only consumer).Testing
Repro'ed the original issue by using the REPL and a
ota-provider-app
instance to setup a CASE session to the provider, and then sending it aAnnounceCommand
indicating the REPL is the provider.I validated that the changes here correctly resulted in the app re-using the CASE session to initiate the query.
I also validated that subsequent tear-down of the REPL, restart and re-doing the above flow resulted in the query image using the newly created session.