-
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
Change SessionHolder to a weak ref #18397
Conversation
2bffbcd
to
8fcb4de
Compare
PR #18397: Size comparison from b4586be to 20db28f Increases (27 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
Decreases (5 builds for cc13x2_26x2)
Full report (27 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
|
|
||
private: | ||
Optional<ReferenceCountedHandle<Transport::Session>> mSession; | ||
Optional<std::reference_wrapper<Transport::Session>> mSession; |
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.
Why can't all of this just become Transport::Session *mSession
? What's the value to saying it's an "optional reference"?
#18431 This issue raised by Tennessee makes me feel that is may not feasible to map We almost gain nothing from this PR. |
So, in conversations with @kghost, there is an issue with Currently, the SDK uses In the new weak-ref model being espoused here, the EC would now only hold a weak-reference to the session. This goes with the general philosophy that EC's should get terminated when sessions get terminated (and to do that, having the EC hold a weak-ref would seem most natural). However in this scheme, it's now possible for the Possible solutions include:
|
Problem
Rework
SessionHandle
/SessionHolder
with the idea by @mrjerryjohnsChange overview
SessionHolder
do not change ref count any moreSince
SessionHolder
is a weak ref now, InPairingSession
, we have to use a handle to grab both unauthenticated session and secure session.TODO:
SessionHolder
toSessionWeakPtr
UnauthenticatedSession
is not longer LRU, it can be released immediately once its refcount becomes 0Testing
Passed unit-tests