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

Timeouts, retries don't work when a state returns True #12

Open
cviveiro opened this issue Jan 29, 2019 · 4 comments
Open

Timeouts, retries don't work when a state returns True #12

cviveiro opened this issue Jan 29, 2019 · 4 comments
Assignees

Comments

@cviveiro
Copy link

Found this morning, I'd changed a state to return True rather than None, and all of a sudden timeouts in that state didn't work. I changed it back, and they do. @knitHacker looked into it just now and says that when we return True we run the on_leave method, which will reset both the timers and the retries. That seems unexpected to me.

@Jeff-Ciesielski

@Jeff-Ciesielski
Copy link
Contributor

So I think that this should technically be an error. States should return a state, or nothing. I'll update documentation, but would you be comfortable if this just raised a ValueError?

@cviveiro
Copy link
Author

SGTM

@Jeff-Ciesielski Jeff-Ciesielski self-assigned this Jan 29, 2019
@knitHacker
Copy link
Contributor

We explicitly had in the comments and functionality that if you return True a message wasn't sent to the trap function.

@knitHacker
Copy link
Contributor

If we didn't return anything at all, or we returned that we swallowed the message, we'll assume that the FSM is no longer busy and is waiting on some external message to move the state along

It's long past time we wrote up some formal specs.

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

3 participants