-
-
Notifications
You must be signed in to change notification settings - Fork 102
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
Fix RestartStrategy::timeout < 1s #265
Conversation
Fix issue where fractions of a second are ignored internally. This leads to a broken `RestartStrategy` when given a timeout of eg. `Duration::from_millis(999)`. NOTE: The type casting of `multiplier` can get removed but that would be a breaking change. I leave this for the reviewer to decide.
Hey, thanks a lot for the pull request! In our first implementation, we hadn't thought of a timeout < 1 sec, so that's a very welcome patch! I'll leave it up to @Relrin to review the changes, because I think he's been working on it the most. He might be able to decide whether we wanna make a breaking change (there's a lot of things happening on the executor side, so we might wanna bump both at the same time). Thanks again! |
Hey, @nicolaiunrein In general, it looks good. However, before merging this patch, we will need a couple of more changes:
I think it will be competely fine to deliver a new version with a couple of "breaking changes" in the single release. Plus, there's no significant impact on existing users because most of the users not going for exceed And yeah, thanks ahead for the patch! |
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.
Changing the multiplier
/ restarts_count
field types in the RestartStrategy
structure to the u32
type will eliminate type converstions.
I realized that after all
So feel free to undo the last commit. |
In practice this is a quite rare case, and for the most users is more than enough to have a delay calculated with integer values. So, I think it's reasonable to left it as it for now :) |
I think we're a cargo fmt away from merging it ! 🎉 |
Do you want me to revert to u32? |
Yes, please, revert it back to the u32 type |
This reverts commit 61e544c.
Amazing, thanks a lot for your contribution! 🎉 |
* dispatch to available children only. (#268) * Fix RestartStrategy::timeout < 1s (#265) * Renamed ActorStateData struct to Context * Extended available states for Actor * Added methods for additional states * Added removed state * Added definition module * Added Definition struct * Removed unsafe Send and Sync implementation for MailboxTx * Added docstrings for Mailbox<T> * Added tests for the Definition struct * Added presaving messages * Removed excessive imports * Added methods for getting latest message * Removed reference for the returned envelope * Code review changes Co-authored-by: Jeremy Lempereur <[email protected]> Co-authored-by: nicolaiunrein <[email protected]>
* dispatch to available children only. (#268) * Fix RestartStrategy::timeout < 1s (#265) * Renamed ActorStateData struct to Context * Extended available states for Actor * Added methods for additional states * Added removed state * Added definition module * Added Definition struct * Removed unsafe Send and Sync implementation for MailboxTx * Added docstrings for Mailbox<T> * Added tests for the Definition struct * Added presaving messages * Removed excessive imports * Added methods for getting latest message * Removed reference for the returned envelope * Code review changes
Fix issue where fractions of a second are ignored internally. This leads to a broken
RestartStrategy
when given a timeout of eg.Duration::from_millis(999)
. NOTE: The type casting ofmultiplier
can get removed but that would be a breaking change. I leave this for the reviewer to decide.Checklist
cargo test
.