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

execute() is called just once for the first state of a concurrent container #87

Closed
benmaidel opened this issue Nov 18, 2019 · 4 comments

Comments

@benmaidel
Copy link

benmaidel commented Nov 18, 2019

The execute() function of the concurrent's first state (the one where the initial state dot is connected to) is called just once.

Example root:
image

Example concurrent container:
image

The concurrent container does have three wait states. wait_1 which will wait for one second. wait_2 wait's for two seconds and wait_3 for three seconds. The expected behavior would be a finished outcome of the container. wait_1 should result in done after one second and the concurrent container should preempt the other two wait's. But that is not the case. After two seconds wait_2 finishes and triggers the failed outcome of the concurrent container.

I could track the problem a bit down and believe that the bug was introduced in f4bf981. First concurrent state's remaining-sleep-duration will always be above 0 after the first run. So the execute will never get called again...

test_behaviors.tar.gz

@pschillinger
Copy link
Member

Good catch, thanks for reporting!

The bug was indeed introduced by the commit you mentioned and appeared to be caused by the fact that sleep mechanism of the concurrency container was called incorrectly. In fact, in your example, always the sleep function of the rate object of the first state is called, irrespectively of which state executes. That's the reason why the first state always had a positive sleep time.

Can you take a look at the PR #88 and verify whether the fix works as you would expect? Thanks!

@benmaidel
Copy link
Author

Can you take a look at the PR #88 and verify whether the fix works as you would expect? Thanks!

Thank you for the quick solution. I can confirm that the fix works as expected.

@drazenb
Copy link

drazenb commented Nov 27, 2019

I ran into the same issue yesterday and I can also confirm the fix above works.

@LoyVanBeek
Copy link
Contributor

Works like a charm. Issue can be closed I think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants