-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix deadlock caused by STP violation
- Loading branch information
1 parent
a961d9c
commit 9a797bb
Showing
1 changed file
with
3 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
9a797bb
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.
For the record, I would like to add a comment on why this commit is necessary to prevent the deadlock we were observing. The situation that led to the deadlock is when a federate is being bombarded with tardy messages. It is using decentralized coordination, so it advances its tag based on the local physical clock. It then receives a message that is "in the past" relative to its current tag. Each time it receives a message, it updates the
last_known_status_tag
field of the action that handles the message. Here, it is also updating this field when it pops events off the event queue that point to this trigger. The problem is that if more than one tardy messages gets pushed onto the event queue before previous ones have been popped, before this fix, thelast_known_status_tag
field would move backwards in time.As far as I know, the
last_known_status_tag
field is only used in federated execution, and since it gets set when messages arrive, it probably doesn't need to be set at all in here, in_lf_pop_events
. It may not actually be possible to use this field reliably in general because it won't tell you much with multiports, where one channel could lag behind another. In federated, this is not a problem because multiports get separated into individual actions.