-
Notifications
You must be signed in to change notification settings - Fork 7
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
[Feature] Generate flow events for every flow added or removed #52
Conversation
Added new listen_to to publish installed events Added _update_flow_state_store Added new 'kytos/flow_manager.flow.pending' event
@@ -87,6 +87,14 @@ def stored_flows_list(self, dpid): | |||
"""Ordered list of all stored flows given a dpid.""" | |||
return itertools.chain(*list(self.stored_flows[dpid].values())) | |||
|
|||
def stored_flows_by_state(self, dpid, state): |
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.
This kind of filtering here we can delegate and perform directly on a DB later as we move to a new back-end later on.
Updated send_napp_event on connection error with error_exception
Co-authored-by: Antonio Francisco <[email protected]>
Co-authored-by: Antonio Francisco <[email protected]>
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.
Looks good to me. Thanks for the changes, @viniarck. If I understood correctly, the flow events for added and removed were already being sent by flow_manager. However, you PR enhances the reliability of the information provided in the event, so that a flow_manager.flow.added
is only sent when the flows are confirmed to be installed (same for other events). Which means that it will not introduce extra overhead of events, but instead it will only send those events when they are actually trusted to be sent.
Exactly, @italovalcy. Also, clients could leverage this accordingly to have simpler consistency checks in the future, if they can trust and rely on |
Fixes #2
Description of the change
This PR added support to publish the rest of flows events to support reliably publishing events when flows are added, removed, still pending (not confirmed yet), and also handled switch connection error
kytos/core.openflow.connection.error
to bubble up the error to the caller. So, nowflow_manager
clients will be able to react accordingly and handle each event as needed based on their use case, not necessarily all clients will have to react and handle, but as they need, the events to completely handle every case are available, handling thekytos/flow_manager.flow.error
event is highly encouraged though at least, asmef_eline
already does.Release notes
version [5.3.0] - 2021-11.21
Added
kytos/core.openflow.connection.error
and propagating the errorkytos/flow_manager.flow.removed
onOFPT_FLOW_REMOVED
_id
on stored flows to confirm flow operationsSwitchNotConnectedError
exceptionstate
and flows are confirmed by the consistency checkChanged
kytos/flow_manager.flow.added
only when the flow is confirmed