-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Decentralized federation silently delivers the wrong tag #1168
Comments
But how would that work? Should the program exit or drop the message? The error is being detected, but there is just no handler for it. |
Good question. I'm not sure what we should do. Probably not exit. Dropping the message and printing a warning seems reasonable to me. The message should perhaps explain how to provide a handler... |
The way I see it is that logical connections under decentralized coordination provide best-effort alignment. In the case of the original example here, even with an STP offset, the input port might not always align with the timer. An STP violation is not necessarily an error if this best-effort alignment is all that is needed for an application. In other words, not having an STP violation handler could be a legitimate and deliberate design choice. Dropping messages thus can actually be potentially limiting and surprising. Perhaps, as a compromise, we could issue a warning during code generation if there are no STP handlers for a logical connection under decentralized coordination. |
I think the key is this principle: Any execution of an LF program is correct only if it matches LF semantics. Currently, that is not what happens, so this is an incorrect execution. In the case that you don't want to drop the message, you can just provide an STP handler that also handles the message. |
Is it correct LF semantics if events simply disappear (in the case of dropping messages)? |
You are right. Unfortunately, we don't have any consistent exception handling mechanism. Maybe we should think about introducing that. E.g., there would be an API to provide an exception handler function, and the default would be to print an error message and exit? |
I agree that this could be the optimal solution. |
Should we add exception handling as a topic for the retreat? |
Sure! Annotations too. |
In the following example, the Print reactor receives messages at microstep 1 that were sent at microstep 0. The issue is that unless there is an STP violation handler given (it's commented out below), STP violations appear to be silently ignored. Adding an STP handler to the first reaction of Print with offset 0 detects the error, but I think the error should be detected even without it. Otherwise, the program silently executes as if it were doing the right thing.
Running this program gives the following:
The text was updated successfully, but these errors were encountered: