-
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 KeepSubscription flag handling #22805
Merged
andy31415
merged 2 commits into
project-chip:master
from
mrjerryjohns:fix-keepalive-flag-final
Sep 23, 2022
Merged
Fix KeepSubscription flag handling #22805
andy31415
merged 2 commits into
project-chip:master
from
mrjerryjohns:fix-keepalive-flag-final
Sep 23, 2022
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
bzbarsky-apple
approved these changes
Sep 21, 2022
This fixes the KeepSubscription flag handling to be done right at the onset of processing a SubscribeRequest message. This ensures that matching existing subscriptions are evicted before we attempt to continue further processing and allocation of ReadHandlers. Testing: In addition to the new test in TestRead, validated setting up a sub in chip-tool and then cancelling it by sending another sub to an invalid endpoint: basic subscribe location 0 5 2 0 any subscribe-by-id 0xFFFFFFFF 0xFFFFFFFF 0 5 2 100 Also tested by sending an empty subscribe request with the REPL.
dd0dc99
to
be34d23
Compare
PR #22805: Size comparison from 388c27c to be34d23 Increases (11 builds for bl602, esp32, linux, nrfconnect, telink)
Decreases (2 builds for linux)
Full report (11 builds for bl602, esp32, linux, nrfconnect, telink)
|
andy31415
approved these changes
Sep 22, 2022
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.
Fixes #22774
This fixes the KeepSubscription flag handling to be done right at the onset of processing a SubscribeRequest message as per the spec. This ensures that matching existing subscriptions are evicted before we attempt to continue further processing and allocation of ReadHandlers.
This also removes logic in
ReadClient
that checks we have at least some paths in the request. By removing this bit of logic, it permits subscriptions with empty paths to be sent to effect a 'cancel subscription' operation of sorts. The validation of that will now happen server-side and an IM error will be sent back, but this can be used to cancel any prior subscriptions on the target.Testing:
In addition to the new test in TestRead, validated setting up a sub in chip-tool and then cancelling it by sending another sub to an invalid endpoint:
Also tested by sending an empty subscribe request with the REPL.