Skip to content
This repository was archived by the owner on Jan 10, 2019. It is now read-only.

Timer fires but no logic run after until workflow times out or exceeds event limit #113

Open
mustafashabib opened this issue Jul 9, 2016 · 1 comment

Comments

@mustafashabib
Copy link

made an example repo: https://github.com/mustafashabib/aws-flow-timer-tests

Playing around with Timers

Seeing weird behavior when you set a timer, it fires, and you have additional code to run
(especially calling an activity via an activity client) from within a method body.

It mostly doesn't work in my tests, but occassionally does work.

This is super confusing.

When it fails, I see the timer fire properly but the subsequent next line of
code never runs - I know this because it is an activity call and I see no call scheduled.

Instead, the SWF workflow sits there and decision tasks get scheduled and timed out until
either the EVENT LIMIT for the workflow is met and the workflow terminated or if the workflow
timeout is exceeded and the workflow is again terminated.

What seems To Always Work

Unrolling all the logic out of workflow methods and putting them into the
main body of the workflow entry point method seems to always work. I tested
this by starting several concurrent workflows while running this code and all
were completed successfully as expected.

When I move the create_timer call and client.echo('something') calls to
a method body such as def schedule_timer_and_echo_via_client() then call
that method from the main workflow method, it sometimes works but mostly does not.

@mustafashabib
Copy link
Author

Just an update - even moving the timer code into the main workflow method doesn't solve this issue.

Is this because my call to create_timer does not provide a do block?

We just want the timers to get created and to wait until they fire before moving forward in the workflow. We had implemented this as create_timer_async calls with do blocks and a wait_for_all call but saw the exact same behavior.

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

No branches or pull requests

1 participant