-
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
Fix error-handling around AddResponseData #15685
Comments
I would suggest making the encoding logic "atomic" (i.e. rollback on failure, just like what we do for attributes) instead of encode a status silently, and then provide a wrapper AddResponseDataOrStatus (just like CheckSuccess in After checking the related code, the of error code for AddResponseData could be one of:
|
Which do we expect consumers to use most? We should have AddResponse have the behavior most consumers want, and have a longer name for the less-commonly-desired behavior....
Agreed.
There can absolutely be bugs in the cluster impl, or bugs in the client (sending multiple commands in a single invoke whose response commands don't all fit in one packet). I'm not actually sure what the best option is for the latter case.... If we get to a point we can't even encode a status in the space left, what should we do? |
@CamWms @mrjerryjohns thoughts on the above? |
I'd agree with updating |
More-over, trying to add a status after that should actually fail to prevent double encoding of a status. |
The internal state of command handler will reject encoding more status, also, when AddStatus failed, the command handler cannot encode anything probably. |
Problem
Right now we have various code that does:
But if AddResponseData failed the TLV is going to be in some broken state, so this error-handling code is just wrong.
Proposed Solution
Move adding on error status into AddResponseData, remove it from all consumers.
The text was updated successfully, but these errors were encountered: