-
Notifications
You must be signed in to change notification settings - Fork 82
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
Add support of VPP events to Stream API #63
Comments
Generally I like trying to move in this direction. I have a few things in my own mind that I have yet to sort out wrt this approach:
I think at the end of the day we need to make sure that Connection is handling the 'Wanted' state of events correctly, only Disabling with VPP in the event there is no longer any consumption of the events going on in the process. |
This would only break users of generated RPC services which is kind of in experimental mode since it uses Stream API. However I agree that this will be mentioned in the first section of changelog under Breaking Changes.
Yes, this is like the
I do not think we should invest too much time into making Channel users happy. We can add some warning where suitable, but I the usage of generated RPC service together with usage of Channel is not intended to be mixed together. And if that is a case, user should take precautions.
This will be the most difficult part to handle reliably in all situations. HOW to enable/disable eventsTo handle the enabling and disabling of events in VPP we first need to either:
Both of these scenarios have their shortcomings though. The VPP API, as usual, is not consistent at all here. See list of event messages and their RPC requests that control them:
There are several different names/types for the boolean field.
On the last community meeting we agreed that I will open discussion on vpp-dev about this so the VPP API is cleaned up and ideally some rules are specified for this including step in the CI pipeline to encorce this for future development. Until then, I guess we could handle the cases mentioned above by hard-coding or checking for possible variations. WHEN to enable/disable eventsThe events in the VPP can be enabled/disabled globally and they are received with context=0 so the destination is the connection (or process) itself. This means to allow multiple watchers for single event we will need to keep reference counter for watchers where we send The problems I see with this are:
|
Opening this issue to track progress of design and implementation of event support in new Stream API which is one of the remaining features required to make this new API complete.
@edwarnicke has already opened a PR #42 with initial implementation:
Ed included some comments on design decisions.
However, before merging this as is, I would like to go over some concerns and possible improvements.
Here is summary of what should be taken into consideration when designing this.
EnableDisable
fieldStream
itself as it already hasRecvMsg() (Message, error)
method for receiving messages.Proposal for generated code
Currently the generated method for enable events has nothing to do with the actual event message:
Instead, RPC method that enables events could work in a similar way that dump requests do:
however this example above does not check
EnableDisable
field and perhaps should not even accept request messageWantWireguardPeerEvents
from user, but handle it in way that enables events at beginning and disables them when ending.The text was updated successfully, but these errors were encountered: