-
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 cancellation of subscriptions to work correctly. #28569
Fix cancellation of subscriptions to work correctly. #28569
Conversation
When a subscription came in with KeepSubscriptions set to false, we would just directly delete the ReadHandlers for the subscriptions not being kept, instead of calling Close(). That meant we skipped deleting subscription persistence data, and also failed to correcly update the reporting engine's round-robin reporting state, which could lead to subscriptions not being serviced fairly. The fix is to just call Close() just like we do for out-of-resource eviction, instead of manually deleting the object.
PR #28569: Size comparison from 367a0c6 to bdded51 Increases (6 builds for cc32xx, psoc6, telink)
Decreases (45 builds for bl602, bl702, bl702l, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
Full report (58 builds for bl602, bl702, bl702l, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
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.
In original logic, assume we have not yet added persistent subscription logic, then we delete the readhandler from pool, the destructor would be called, it would call onReportConfirm if it is in IsAwaitingReportResponse so the report engine's state can be updated well. after applying your improvement, it would call close, and it move to AwaitingDestruction and reporting engine's state can be updated as well.
11:35
since we have added persistent subscription logic, we do need clear the persistent logic via explicit close call
just approve the pr, thanks
../../src/app/InteractionModelEngine.cpp -o obj/src/app/libCHIPDataModel.InteractionModelEngine.cpp.o this needs to be tested. |
can we have the job to enable CHIP_CONFIG_PERSIST_SUBSCRIPTIONS flag, and test the persistent subscription can be removed when closing the readhandler? |
No, it was still missing the |
I did test it, fwiw, on esp32 where I ran into the issue. It compiles there. ;) |
PR #28569: Size comparison from 367a0c6 to c625139 Increases (2 builds for linux, telink)
Decreases (52 builds for bl602, bl702, bl702l, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
Full report (60 builds for bl602, bl702, bl702l, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
) * Fix cancellation of subscriptions to work correctly. When a subscription came in with KeepSubscriptions set to false, we would just directly delete the ReadHandlers for the subscriptions not being kept, instead of calling Close(). That meant we skipped deleting subscription persistence data, and also failed to correcly update the reporting engine's round-robin reporting state, which could lead to subscriptions not being serviced fairly. The fix is to just call Close() just like we do for out-of-resource eviction, instead of manually deleting the object. * Fix build issue.
* Fix cancellation of subscriptions to work correctly. When a subscription came in with KeepSubscriptions set to false, we would just directly delete the ReadHandlers for the subscriptions not being kept, instead of calling Close(). That meant we skipped deleting subscription persistence data, and also failed to correcly update the reporting engine's round-robin reporting state, which could lead to subscriptions not being serviced fairly. The fix is to just call Close() just like we do for out-of-resource eviction, instead of manually deleting the object. * Fix build issue.
) * Fix cancellation of subscriptions to work correctly. When a subscription came in with KeepSubscriptions set to false, we would just directly delete the ReadHandlers for the subscriptions not being kept, instead of calling Close(). That meant we skipped deleting subscription persistence data, and also failed to correcly update the reporting engine's round-robin reporting state, which could lead to subscriptions not being serviced fairly. The fix is to just call Close() just like we do for out-of-resource eviction, instead of manually deleting the object. * Fix build issue.
…roject-chip#28569) * Fix cancellation of subscriptions to work correctly. When a subscription came in with KeepSubscriptions set to false, we would just directly delete the ReadHandlers for the subscriptions not being kept, instead of calling Close(). That meant we skipped deleting subscription persistence data, and also failed to correcly update the reporting engine's round-robin reporting state, which could lead to subscriptions not being serviced fairly. The fix is to just call Close() just like we do for out-of-resource eviction, instead of manually deleting the object. * Fix build issue.
…ectly. (project-chip#28569)" This reverts commit 5e90d7d.
When a subscription came in with KeepSubscriptions set to false, we would just directly delete the ReadHandlers for the subscriptions not being kept, instead of calling Close().
That meant we skipped deleting subscription persistence data, and also failed to correcly update the reporting engine's round-robin reporting state, which could lead to subscriptions not being serviced fairly.
The fix is to just call Close() just like we do for out-of-resource eviction, instead of manually deleting the object.