-
Notifications
You must be signed in to change notification settings - Fork 50
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
Handles host bounce after crash #89
Handles host bounce after crash #89
Conversation
Fixing issue that host was removed from the sim state after host crash. With this fix, we change the way how we track state of the host during simulation. Crashed and hosts that have finished it's execution are no longer removed from simulation's state, that allowed us to bounce them. We might need to add explicit way to remove hosts from simulation in the future but there is no need to do it right now. This change also encapsulates host's state management and it's operations(e.g. crash/bounce) into Role type that allowed to simplify Sim::step function code and make task's state management code more clean.
I agree |
I've stuck with renaming. I like current Current
|
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.
Nice refactor idea for tick. Comments are mostly around naming and docs.
Role turn out to become mostly wrapper around Rt, so this change merges it into Rt, combining software status tracking and runtime ticks.
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.
Nice changes. Comments are all doc suggestions.
Co-authored-by: Brett McChesney <39924297+mcches@users.noreply.github.com>
Hosts were made fallible in tokio-rs#67, which surfaced a bug in the sim's event loop when hosts were crashed. This fixes that issue by extracting the software result on completion and includes some refactoring to consolidate `Role` and `Rt`.
Fixing issue that host was removed from the sim state after host crash. With this fix, we change the way how we track state of the host during simulation. Crashed and hosts that have finished it's execution are no longer removed from simulation's state, that allowed us to bounce them. We might need to add explicit way to remove hosts from simulation in the future but there is no need to do it right now.
This change also encapsulates host's state management and it's operations(e.g. crash/bounce) into Role type that allowed to simplify Sim::step function code and make task's state management code more clean.
Update: @th7nder submitted #89 in parallel, with the same approach to the fix but without refactoring. I don't mind to go with it if my refactoring is too much.
Special focus:
finished_err
function. It feels weird to checkis_finished
and then callfinished_err()
? but I was not able to come up with better way to do it.Index<addr, Option<Role>>
didn't work out well. It polluted code with handling option is none and expects. After moving state into Role code become more clean.