Streaming events URL support "not to use cache"#45
Merged
renukamanavalan merged 11 commits intosonic-net:masterfrom Oct 13, 2022
Merged
Streaming events URL support "not to use cache"#45renukamanavalan merged 11 commits intosonic-net:masterfrom
renukamanavalan merged 11 commits intosonic-net:masterfrom
Conversation
When configured via args:
1) Write responses only to a o/p file instead of stdout.
2) For on change events, filter for a specific event.
3) Exit upon receiving N responses.
4) Exit upon timeout.
The above would help use gnmi_cli as tool in scripting environment that does testing.
* syntax
* Update gnmi_cli
When configured via args:
1) Write responses only to a o/p file instead of stdout.
2) For on change events, filter for a specific event.
3) Exit upon receiving N responses.
4) Exit upon timeout.
The above would help use gnmi_cli as tool in scripting environment that does testing.
…e" in Query URL. This is useful as only one events client can use cahe. The only client that uses cache today is gNMI events-client. So when we use gnmi_cli, which also uses events-client, have the ability to disable cache. This way, while GWS service is connected, we could still use gnmi_cli w/o any impact to GWS service.
ganglyu
reviewed
Oct 13, 2022
| <br/> | ||
| The SONiC switch does offline cache when gNMI client is down.<br/> | ||
| The cached events are delivered upon nest gNMI connection<br/> | ||
| Only one client should use the cache service<br/> |
Contributor
There was a problem hiding this comment.
How to guarantee this limitation?
If two clients use the cache service, what will happen?
Contributor
Author
There was a problem hiding this comment.
Limitation by design.
Trade off between code complexity in supporting multiple clients with cache vs practical use case.
In practice, there is only one client streaming out.
This is added to enable test tools to function w/o disturbing the main service.
To answer your question: If multiple use cache, of course first come first served. The cache will go to one or other.
ganglyu
approved these changes
Oct 13, 2022
This file contains hidden or 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
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.
Why I did it
Only one gNMI client can use cache at any time.
The external clients that stream events reliably need to use cache.
While an external client is connected, if we need to use some test client (e.g. gnmi_cli), it could be used provided it does not use cache.
How I did it
Added support for a new URL parameter [usecache=false]. This parameter will disable use of cache.
How to verify it
Which release branch to backport (provide reason below if selected)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)