-
Notifications
You must be signed in to change notification settings - Fork 137
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
[#1858] Skip removeCommandHandlingAdapterInstance if entry has expired #1922
Conversation
…red. With the 'lifespan' parameter of the 'setCommandHandlingAdapterInstance' operation being mandatory to implement now for Device Connection API implementations, the explicit removal of a command handling adapter instance entry can be skipped if the entry has expired. Signed-off-by: Carsten Lohmann <[email protected]>
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.
do you think it is actually worth the effort to do these checks? Why not simply send a remove message in any case?
Effort-wise (from a runtime perspective), I think it's better to do this time-interval check here instead of sending the remove message for an entry that has already expired anyway. |
The adapter doesn't care about the outcome anyway, does it? In the end, what is an adapter supposed to do if it gets a 404? |
There is nothing actually done with the outcome, yes. But the 404 outcome will be visible in the tracing span - marking the whole span as an error (setting the error span tag is done in the In general I think having that method included in the overall span is important to see any other kinds of errors when they occur here. (I also have a PR in preparation letting the remove operation span be included in the parent |
my understanding is that we return a 404 if the currently registered command handling adapter instance is not the one that has been passed in to the remove command, right? I do understand that we return a 404 in that case in order to let the client know, but I wouldn't consider this a reason to mark a Span as erroneous since it is an expected (and handled) situation because the device might have connected to another adapter instance already, or am I mistaken? |
Yes, a 404 shouldn't be regarded as an error in any case here. In order to let the |
Makes sense to me |
I've created #1926 to replace this PR, including the above mentioned changes to the |
This is for #1858 and updates the implementation based on the API spec change in PR #1917:
With the 'lifespan' parameter of the 'setCommandHandlingAdapterInstance' operation being mandatory to implement now for Device Connection API implementations, the explicit removal of a command handling adapter instance entry can be skipped if the entry has expired.