-
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
[chiptool.py] Ensure async report that came in before the test got a … #28257
[chiptool.py] Ensure async report that came in before the test got a … #28257
Conversation
PR #28257: Size comparison from 3efdd36 to 0ce12fd Increases (10 builds for bl602, bl702, cyw30739, linux, psoc6, telink)
Decreases (9 builds for bl702, nrfconnect, qpg, telink)
Full report (60 builds for bl602, bl702, bl702l, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
examples/chip-tool/commands/interactive/InteractiveCommands.cpp
Outdated
Show resolved
Hide resolved
examples/chip-tool/commands/interactive/InteractiveCommands.cpp
Outdated
Show resolved
Hide resolved
examples/chip-tool/commands/interactive/InteractiveCommands.cpp
Outdated
Show resolved
Hide resolved
// If we are not waiting for result it could be that a report came in *before* the command to wait for | ||
// it has happened. The result is stored until the next command. If the next command is an async | ||
// command the pending result would be promote to a valid result so it could be dispatched properly. | ||
if (!mEnabled) |
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.
So just in terms of ordering. Say I have YAML that does:
- Send a command.
- Wait for a report on a subscription caused by the changes due to that command.
What happens if the report comes before the command response?
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.
That is a good question and I don't have a good response handy.
The way it works today is that the report will likely be added to the command response itself.
In this case, we could probably update the python implementation to "consume" the report before feeding the response processor and save it until the next command. If the next command is a wait for report, then we could probably avoid to do a network round trip and give it directly as a response.
It may requires a few more changes to the adapter implementation, especially since the encoder
and the decoder
does not communicate at all as of today. Is that required at the moment ?
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.
I think it would be good to track as a followup, because nothing guarantees the subscription report will come after the command response.... But in general it usually should, so we can start here to unblock people.
examples/chip-tool/commands/interactive/InteractiveCommands.cpp
Outdated
Show resolved
Hide resolved
if (gInteractiveServerResult.HasResults()) | ||
{ | ||
mWebSocketServer.Send(gInteractiveServerResult.AsJsonString().c_str()); | ||
gInteractiveServerResult.Reset(); |
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.
What happens if we have received part of the report (which is being chunked due to not fitting in a packet) before we get to this point, but not the whole report? I guess this only matters for non-single-attribute subscriptions and YAML tests should not do those?
…chance to listen for a report are dispatched properly
0ce12fd
to
272d6fd
Compare
PR #28257: Size comparison from 97964db to 272d6fd Increases (10 builds for cyw30739, esp32, linux, psoc6, telink)
Decreases (17 builds for bl602, bl702, bl702l, efr32, esp32, nrfconnect, psoc6, telink)
Full report (60 builds for bl602, bl702, bl702l, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
PR open for over 1 year ... closing as stale if it did not get merged yet. |
…chance to listen for a report are dispatched properly
Problem
When a YAML test is listening for an async result such as subscription report, it may happen that the report came in before the listener has been installed. This PR ensure that reports are stored as pending results and are dispatched instantly if a command to get those async result came in.
fix #19861