-
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
Reduce dangling session handle #9225
Conversation
currently SessionHandle is not able to identify a unauthenticated session, create an empty handle for itconnectedhomeip/src/transport/SessionHandle.h Lines 65 to 73 in 0bfac14
This comment was generated by todo based on a
|
62d159e
to
e9f4872
Compare
e9f4872
to
f7cbced
Compare
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.
Marking Request changes while we discuss the optional reimplementation..
149950e
to
849d27c
Compare
@mspang I have rebased the PR to use the new optional implementation. |
1c37e36
to
d835a0c
Compare
d835a0c
to
0ff35a1
Compare
Size increase report for "gn_qpg-example-build" from 9dfa537
Full report output
|
Size increase report for "esp32-example-build" from 9dfa537
Full report output
|
Size increase report for "nrfconnect-example-build" from 9dfa537
Full report output
|
Problem
There are lots of dangling session handle in our code, due to following 2 reasons:
Case.1 is solved by using
Optional<SessionHandle>
Case.2 will be solved in the future by assigning an unauthenticated session, associate the session with its peer address
Change overview
SessionHandle
SessionHandle
field withOptional<SessionHandle>
, if the life-span of the field can be longer than the session. For example,ExchangeContext::mSessionHandle
, theExchangeContext
can still exist even if the session has been closed, in this circumstance, themSessionHandle
should not hold a session.Testing
Manually tested using unit-tests.