-
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
[IM] Calculate interaction model timeout accoring to RMP timeouts #18744
Conversation
PR #18744: Size comparison from 352333a to 39f06d5 Increases (35 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
Decreases (19 builds for cc13x2_26x2, esp32, linux, nrfconnect)
Full report (35 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
|
Co-authored-by: Boris Zbarsky <[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.
This doesn't quite line up with what was specified in the issue, and needs more discussion.
Had a long chat with @tcarmelveilleux, and he made a great suggestion that I think will make this a lot simpler, while still providing applications the ability to do transport-adjusted timeouts. Here's what we eventually arrived at:
@erjiaqing let me know what you think. |
The above does mean however that we'll need to modify chip-tool and the REPL to then permit specifying an extra "adjust for transport" parameter to alter the underlying timeout computation... |
So, after thinking about this a bit more, I'm starting to come around to the premise of the original solution in this PR. It seems clear that applications have to choose between specifying an absolute timeout, vs a transport-adjusted timeout. You cannot live with just either option alone. There are going to be applications that are about interactiveness, and do not want to be subject to the variance induced by a sleepy target when deciding a timeout for that application. There are also going to be applications that do want to interact with these classes of devices (consciously), and want to bias towards interaction success and not responsiveness. The use of 0 as a way to select 'auto transport adjusted' and non-zero to select 'absolute timeout' seems like a fine way to select this modality. My original concern was the inability to then specify any adjustments when selecting 'auto', but in 99% of interactions, the amount of time it takes to execute a command on the receiver is always quite low (i.e fairly quick). In the cases where it isn't, applications can manually make adjustments if need-be. However, I think it would be useful if the computation of the actual absolute timeout is not specific to the IM. Instead, that should be happening I think, in the exchange layer when Thoughts @erjiaqing @tcarmelveilleux ? |
Infact, I do have some considerations about the use of '0' vs Optional for the default auto timeout setting. However, since
"execute a command" => infact, the timeout is used calculate the timeout of "time to first byte" of the payload e.g. when it comes to reads, it is the timeout for receiving first chunk of reports instead of the whole transaction (I don't suggest the timeout for the whole transaction, since it depends on the actual size of report which cannot be foreseen by the client)
Yes, I will move |
PR #18744: Size comparison from f188fd9 to 4c13a6e Increases (49 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
Decreases (3 builds for cc13x2_26x2)
Full report (49 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
|
PR #18744: Size comparison from 131b13c to ab6facf Increases (44 builds for cc13x2_26x2, cyw30739, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
Decreases (3 builds for cc13x2_26x2)
Full report (44 builds for cc13x2_26x2, cyw30739, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
|
static constexpr System::Clock::Timeout kImMessageTimeout = System::Clock::Seconds16(12); | ||
// This is an expected upper bound of time-to-first-byte for IM transactions, the actual processing time should never exceed this | ||
// value unless specified elsewhere (e.g. async command handling for some clusters). | ||
static constexpr System::Clock::Timeout kExpectedIMProcessingTime = System::Clock::Seconds16(2); |
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.
Is 2 seconds long enough for crypto-heavy commands like AddNOC/UpdateNOC?
Problem
Fixed #16797
Change overview
kImMessageTimeout
kExpectedIMProcessingTime
InteractionModelTimeoutForSession
Testing
Testing steps: