-
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
Sort out who is responsible for cleaning up OperationalDeviceProxy instances when FindOrEstablishSession returns an error #18609
Comments
If we fail to establish CASE, starting again from a clean-slate and re-doing operational discovery is likely the best bet going forward. So I don't think holding onto that instance is worthwhile.
I'm not a big fan of objects deleting themselves, since it makes allocation and destruction quite asymmetric - I'd prefer the model where CASESessionManager handled both allocation and destruction if we could. The suggestion I made in #18583 is one way to achieve that while preserving a large section of our current API surface. |
To be clear, this would be more like a "I failed" call on the CASESessionManager, and that would then do the cleanup.... |
I agree upon the part that the address should not be handled inside
Agree, but we are already doing this in |
How so? It just invokes callbacks, it doesn't actually delete itself. |
So, the other detail here we need sorting out (which is the broader question here), is exactly how we expect multiple logical clients to interact with E.g The OTA-R cluster logic, as well as BindingsManager (see this comment in a recent PR). This goes beyond just free'ing up on error... |
At some point, I had gotten to a good head-space in conversations with someone (forget whom), that every logical application client in the system would have their own instance of The pro with this model is that there is no need to then figure out shared-ptr-like allocation/de-allocation strategies for sharing use of The con with this model is that two clients setting up their own |
Right, sharing the discovery and session establishment is why we common up operational device proxies.... |
This might end up in significant API changes to how CASE is done. |
This is now duplicated by #19259 |
Problem
Right now if someone calls
CASESessionManager::FindOrEstablishSession
and the result is a failure, it's not clear what happens to theOperationalDeviceProxy
that was allocated to track the connection establishment. Some consumers callCASESessionManager::ReleaseSession
on the peer id that failed to resolve. Some do nothing in particular.Proposed Solution
The big question is whether it's worth holding on to proxies that have reached the HasAddress state even if the following CASE establishment failed. My suspicion is that it probably is not, especially in situations where there are OS-level DNS-SD caches.
If we accept that, and given that the failure callback does not provide a pointer to the proxy as part of its signature, I think we could have failed OperationalDeviceProxy instances automatically clean themselves up before dispatching the failure callbacks. They would need a pointer to the CASESessionManager to do that, I guess. But we could either add it, or replace the by-value
DeviceProxyInitParams
that a device proxy has now with a pointer to the CASESessionManager that it can then get the params from.@kghost @msandstedt @mrjerryjohns thoughts?
The text was updated successfully, but these errors were encountered: