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

We should only notify the stop listener AFTER post_stop #257

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

slawlor
Copy link
Owner

@slawlor slawlor commented Sep 13, 2024

We should only notify the stop listener AFTER post_stop has executed, which is when the state gets set to Stopped

Closes #254

Test plan

A new test has been added called actor_post_stop_executed_before_stop_and_wait_returns. Before the fix it fails with

---- actor::tests::actor_post_stop_executed_before_stop_and_wait_returns stdout ----
2024-09-13T15:47:34.344047Z TRACE actor_post_stop_executed_before_stop_and_wait_returns:Actor{id="0.0"}: ractor::actor: Actor Local(0) stopped with no reason
thread 'actor::tests::actor_post_stop_executed_before_stop_and_wait_returns' panicked at ractor/src/actor/tests/mod.rs:1040:5:
assertion `left == right` failed
  left: 1
 right: 0
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    actor::tests::actor_post_stop_executed_before_stop_and_wait_returns

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 82 filtered out; finished in 0.02s

and with the patch here it succeeds.

@slawlor slawlor force-pushed the fix_post_stop_hook branch 2 times, most recently from 5a97b73 to 9c6aa82 Compare September 13, 2024 15:52
…d, which is when the state gets set to `Stopped`

Closes Add a pre_stop fn or some way to wait until post_stop has finished #254
@slawlor slawlor marked this pull request as ready for review September 13, 2024 16:11
@slawlor slawlor merged commit cc70993 into main Sep 13, 2024
12 checks passed
@slawlor slawlor deleted the fix_post_stop_hook branch September 13, 2024 16:34
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

Successfully merging this pull request may close these issues.

Add a pre_stop fn or some way to wait until post_stop has finished
1 participant