-
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
Graph receipt message type and message_id #21
base: master
Are you sure you want to change the base?
Conversation
@@ -118,7 +51,7 @@ input: | |||
protocol: | |||
enum: ['graph'] | |||
command: | |||
enum: ['addnode'] | |||
enum: ['clear'] |
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.
bugfix
Yeah, we were just talking about this. Version 4 sounds good. |
addnode: | ||
id: 'output/addnode' | ||
description: 'Add node to a graph.' | ||
$ref: '../input/addnode' |
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 is an incompatible change and I don't see the reason for it?*
The graph operations need to reply with something, and might as well reply with something specific. The reply sent should then contain the id
of the request it is a reply to, and this can be used to correlate it.
*
and we have like 7 implementations of the protocol, so we should to be cautious with breaking things.
As you know, right now there is no way to know which messages are replies to what. But there is also a usecase for having 'undirected' messages coming from runtime: Supporting multiple clients. |
I definitely want to make sure this is compatible with multiple clients, and that is exactly the use case I have in mind with this proposal. An example of the flow I was envisioning goes like this: let's say a client first adds a node to a graph. The client then sends an I think it would be nice if there is a distinction between the |
The protocol defines commands and responses between exactly two peers. If the peer receiving the Regarding breaking changes: there will be a handful of them coming up (proper handling of types will likely be a breaking change). I think this is only to be expected since we've added an active outside perspective. I don't want to cause unnecessary work for anyone, but I think we all agree there are things that need to be improved and extended. We might need to make a 0.6 release that defines and requires a proper handshake between peers, so that there's a known protocol for dealing with incompatible protocol versions (i.e. a client using protocol 0.5 should abort if it encounters a runtime using 0.6, and vice versa). Then we can bundle up the bigger changes to the protocol in a 0.7 release. |
Why should the runtime wait for receipts from clients? And what would it do if it did not receive them, or received error? |
If we introduce breaking changes, we need to maintain parallel support protocol in clients until all runtimes are updated. And I would expect those that argue for breaking changes to contribute significantly to this work, as otherwise one has misaligned incentives (the cost of the breaking change is carried by someone else). |
I can think of a few possibilities:
If a client gets out of sync with the runtime, this can lead to very bad things, especially with multiple clients compounding the problem. At best the runtime state is simply broken and can't be executed, at worst, it can lead to unintended actions executed by the graph which are destructive. A runtime disconnecting from a client that responds with an error Most of the fbp-protocol adheres to a distinction between runtimes and clients. A Our arguments for this design are:
Regarding the latter, here's our proposal in words: "Every graph edit starts with a Your is something like: "Graph commands coming from the client should be responded to by the runtime with a If I've made a mistake there, please correct me. I'm not sure how the By the way, we greatly appreciate you engaging us in this debate. I know it takes a lot of effort to get everyone's mental model in sync (it's a peer-to-peer system, I think ;) I think the forthcoming changes are really going to benefit from everyone's perspective. |
Just my two cents: hot-code reloading is a big feature for developers (esp. front-end). If I understand right, noflo/noflo-ui#564 depends on this PR, and once both are merged, they would enable noflo-ui's graph to update based on the runtime's state. Very much looking forward to this. If there are any low-priority/tedious tasks to do, I'm happy to help. |
This pull request adds a top level id to every message. By adding unique ids to every message we can have a runtime or ui respond to graph message with a receipt instead of just echoing back the original message to make sure the message was received. Echoing the messages causes some infinite looping issues when both a runtime and it's client are trying to update each other.