-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Rollback() on data model builder should reset the error on the builder. #26982
Merged
andy31415
merged 2 commits into
project-chip:master
from
bzbarsky-apple:rollback-reset-state
Jun 2, 2023
Merged
Rollback() on data model builder should reset the error on the builder. #26982
andy31415
merged 2 commits into
project-chip:master
from
bzbarsky-apple:rollback-reset-state
Jun 2, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pullapprove
bot
requested review from
amitnj,
andy31415,
anush-apple,
arkq,
carol-apple,
chrisdecenzo,
chshu,
chulspro,
cliffamzn,
Damian-Nordic,
dhrishi,
electrocucaracha,
emargolis,
franck-apple,
gjc13,
harimau-qirex,
harsha-rajendran,
hawk248,
jelderton,
jepenven-silabs,
jmartinez-silabs,
jmeg-sfy,
joonhaengHeo,
jtung-apple,
kcoppock,
kkasperczyk-no and
ksperling-apple
May 31, 2023 18:38
pullapprove
bot
requested review from
robszewczyk,
saurabhst,
selissia,
sharadb-amazon,
tecimovic,
vijs,
vivien-apple,
woody-apple,
xylophone21,
younghak-hwang and
yufengwangca
May 31, 2023 18:38
PR #26982: Size comparison from d145bbb to fb998cb Increases above 0.2%:
Increases (9 builds for bl602, bl702, cc32xx, psoc6)
Decreases (54 builds for bl702, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, telink)
Full report (56 builds for bl602, bl702, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, telink)
|
andy31415
approved these changes
May 31, 2023
bzbarsky-apple
commented
Jun 1, 2023
yunhanw-google
approved these changes
Jun 1, 2023
Without this, it's too easy to forget to ResetError() when rolling back. That's exactly what happened in ClusterStateCache:OnUpdateDataVersionFilterList, and that could lead to inability to ever re-subscribe after a subscription drop. We had the following Rollback() calls not immediately followed by ResetError(): * In SendFailureStatus in ember-compatibility-functions.cpp. This is never reached when there is a failure on aAttributeReports, so doing the ResetError here is not a problem. * AttributeValueEncoder::EncodeListItem. This was relying on the InteractionModelEngine to ResetError after the rollback. * ClusterStateCache:OnUpdateDataVersionFilterList. When CreateDataVersionFilter() failed, this could leave the DataVersionFilterIBs::Builder in an error state, which would lead to the subscribe request (incorrectly) failing completely. * WriteHandler::ProcessAttributeDataIBs. This codepath was apparently not getting hit in practice, since it would fail. It was also checkpointing/restoring on the wrong builder. * Engine::BuildSingleReportDataAttributeReportIBs. This was buggy: If we hit an error other than "out of memory" while encoding the value, we could end up with the builder in an error state and then fail to encode our status response. * ReadClient::SendReadRequest. This is never reached with an error on the builder. * ReadClient::SendSubscribeRequestImpl. This is never reached with an error on the builder.
bzbarsky-apple
force-pushed
the
rollback-reset-state
branch
from
June 1, 2023 18:11
fb998cb
to
783acd5
Compare
PR #26982: Size comparison from 28e0423 to 783acd5 Increases above 0.2%:
Increases (10 builds for bl602, bl702, cc32xx, esp32, psoc6)
Decreases (56 builds for bl702, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
Full report (58 builds for bl602, bl702, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
bzbarsky-apple
added a commit
to bzbarsky-apple/connectedhomeip
that referenced
this pull request
Jun 2, 2023
…r. (project-chip#26982) * Rollback() on data model builder should reset the error on the builder. Without this, it's too easy to forget to ResetError() when rolling back. That's exactly what happened in ClusterStateCache:OnUpdateDataVersionFilterList, and that could lead to inability to ever re-subscribe after a subscription drop. We had the following Rollback() calls not immediately followed by ResetError(): * In SendFailureStatus in ember-compatibility-functions.cpp. This is never reached when there is a failure on aAttributeReports, so doing the ResetError here is not a problem. * AttributeValueEncoder::EncodeListItem. This was relying on the InteractionModelEngine to ResetError after the rollback. * ClusterStateCache:OnUpdateDataVersionFilterList. When CreateDataVersionFilter() failed, this could leave the DataVersionFilterIBs::Builder in an error state, which would lead to the subscribe request (incorrectly) failing completely. * WriteHandler::ProcessAttributeDataIBs. This codepath was apparently not getting hit in practice, since it would fail. It was also checkpointing/restoring on the wrong builder. * Engine::BuildSingleReportDataAttributeReportIBs. This was buggy: If we hit an error other than "out of memory" while encoding the value, we could end up with the builder in an error state and then fail to encode our status response. * ReadClient::SendReadRequest. This is never reached with an error on the builder. * ReadClient::SendSubscribeRequestImpl. This is never reached with an error on the builder. * Address review comment.
andy31415
pushed a commit
that referenced
this pull request
Jun 3, 2023
…r. (#26982) (#27054) * Rollback() on data model builder should reset the error on the builder. Without this, it's too easy to forget to ResetError() when rolling back. That's exactly what happened in ClusterStateCache:OnUpdateDataVersionFilterList, and that could lead to inability to ever re-subscribe after a subscription drop. We had the following Rollback() calls not immediately followed by ResetError(): * In SendFailureStatus in ember-compatibility-functions.cpp. This is never reached when there is a failure on aAttributeReports, so doing the ResetError here is not a problem. * AttributeValueEncoder::EncodeListItem. This was relying on the InteractionModelEngine to ResetError after the rollback. * ClusterStateCache:OnUpdateDataVersionFilterList. When CreateDataVersionFilter() failed, this could leave the DataVersionFilterIBs::Builder in an error state, which would lead to the subscribe request (incorrectly) failing completely. * WriteHandler::ProcessAttributeDataIBs. This codepath was apparently not getting hit in practice, since it would fail. It was also checkpointing/restoring on the wrong builder. * Engine::BuildSingleReportDataAttributeReportIBs. This was buggy: If we hit an error other than "out of memory" while encoding the value, we could end up with the builder in an error state and then fail to encode our status response. * ReadClient::SendReadRequest. This is never reached with an error on the builder. * ReadClient::SendSubscribeRequestImpl. This is never reached with an error on the builder. * Address review comment.
maciejbaczmanski
pushed a commit
to maciejbaczmanski/connectedhomeip
that referenced
this pull request
Jul 15, 2024
…r on the builder. (project-chip#26982) (project-chip#27054) * Rollback() on data model builder should reset the error on the builder. Without this, it's too easy to forget to ResetError() when rolling back. That's exactly what happened in ClusterStateCache:OnUpdateDataVersionFilterList, and that could lead to inability to ever re-subscribe after a subscription drop. We had the following Rollback() calls not immediately followed by ResetError(): * In SendFailureStatus in ember-compatibility-functions.cpp. This is never reached when there is a failure on aAttributeReports, so doing the ResetError here is not a problem. * AttributeValueEncoder::EncodeListItem. This was relying on the InteractionModelEngine to ResetError after the rollback. * ClusterStateCache:OnUpdateDataVersionFilterList. When CreateDataVersionFilter() failed, this could leave the DataVersionFilterIBs::Builder in an error state, which would lead to the subscribe request (incorrectly) failing completely. * WriteHandler::ProcessAttributeDataIBs. This codepath was apparently not getting hit in practice, since it would fail. It was also checkpointing/restoring on the wrong builder. * Engine::BuildSingleReportDataAttributeReportIBs. This was buggy: If we hit an error other than "out of memory" while encoding the value, we could end up with the builder in an error state and then fail to encode our status response. * ReadClient::SendReadRequest. This is never reached with an error on the builder. * ReadClient::SendSubscribeRequestImpl. This is never reached with an error on the builder. * Address review comment. (Cherry picked from commit 8db0d65)
maciejbaczmanski
pushed a commit
to maciejbaczmanski/connectedhomeip
that referenced
this pull request
Jul 15, 2024
…the error on the builder. (project-chip#26982) (project-chip#27054)" This reverts commit b1016b7.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Without this, it's too easy to forget to ResetError() when rolling back. That's exactly what happened in ClusterStateCache:OnUpdateDataVersionFilterList, and that could lead to inability to ever re-subscribe after a subscription drop.
We had the following Rollback() calls not immediately followed by ResetError():