Skip to content
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

clips-executive: fix action timeout on nowait action #12

Merged
merged 1 commit into from
Nov 2, 2018

Conversation

morxa
Copy link
Member

@morxa morxa commented Oct 22, 2018

Switch any nowait action that is in the state SENSED-EFFECTS-WAIT to
SENSED-EFFECTS-HOLD.

This fixes a bug introduced by merge 1cf063f which would cause all nowait
actions to block and then eventually timeout.

This restores the behavior introduced with commit f486472.

Switch any nowait action that is in the state SENSED-EFFECTS-WAIT to
SENSED-EFFECTS-HOLD.

This fixes a bug introduced by merge 1cf063 which would cause all nowait
actions to block and then eventually timeout.

This restores the behavior introduced with commit f48647.
@morxa morxa added the bugfix PR fixes a bug label Oct 22, 2018
@morxa morxa requested a review from timn October 22, 2018 13:30
@timn
Copy link
Member

timn commented Oct 24, 2018

What about the domain-pending-sensed-fact facts? When are they eventually cleaned up in the case they are never observed? Couldn't they keep piling up?

What is a use case for having pending effects if they are ignored?

@morxa
Copy link
Member Author

morxa commented Oct 24, 2018

Previously, we always expected that we would always observe all effects of an action, even if it is a nowait action. With the change in f486472, we can now actually track those effects and react if an expected effect does not occur.

Use case:

  1. Prepare a machine, do not wait until it is READY-AT-OUTPUT.
  2. Drive to the output side
  3. Machine is not yet ready, monitoring needs to decide what to do (e,g., wait or fail). For this, we need to know whether we expect the machine state to change.

I agree that this is not the best way to solve this issue, e.g., we need to clean up the pending-sensed-facts, but it served its purpose.

Anyway, this PR is actually only about changing the condition when to switch a nowait action to SENSED-EFFECTS-HOLD. As it is, the rule may not fire because the previous rule changes the state to SENSED-EFFECTS-WAIT.

@timn
Copy link
Member

timn commented Oct 29, 2018

The use case helps to understand the motivation. However, it casts doubt onto f486472. It seems incomplete and maybe it should be removed and re-added when fully finished.

We need a mechanism to cleanup pending sensed effects in suitable situations, e.g., when the corresponding action no longer exists or is marked FAILED or FINAL. I'm also wondering whether such an action goes through the (mandatory) EXECUTION-SUCCEEDED state. It has to occur in any transition sequence for an action to become FINAL.

To better understand this, a minimal working example that shows the intended rule activation flow and state transitions of the action would be useful. Currently, it looks like a hack that provided some utility in some situation, but may have implications or violations of the intended state graph. Maybe something along the lines of the test scenario to show what should occur to follow the trace through an instance. Let's also consider an on-line conversation about this, could help clarify potential misunderstandings quicker.

@morxa
Copy link
Member Author

morxa commented Oct 30, 2018

So yes, the action always goes through EXECUTION-SUCCEEDED. But yes, let's move the discussion to Slack. I'll ping you next week

@morxa
Copy link
Member Author

morxa commented Oct 30, 2018

However, could we still merge this and then reconsider what the best approach is? Currently, nowait actions do not work at all in master...

@timn
Copy link
Member

timn commented Oct 31, 2018

We could also revert the previous change which would make the problem not exist. With merging it exists but we ignore it. I do see the usefulness of knowing what is missing, but we need some cleanup.

To find something in between, I'd suggest you file a detailed issue explaining the problem. I'll take that into account for the review to approve it. But this way we make sure it's not lost. If we cannot find a solution in a reasonable time, we'll revert this and the previous commits.

Once you are back in Edinburgh please provide some of the info I asked for and we chat a little on how to approach this.

Copy link
Member

@timn timn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok for now, follow up in #17.

@morxa morxa merged commit a2e6d59 into master Nov 2, 2018
@morxa
Copy link
Member Author

morxa commented Nov 2, 2018

Thanks for your comments!

@morxa morxa deleted the thofmann/cx-fix-action-timeout-on-nowait-action branch November 2, 2018 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix PR fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants