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

Stop all actors at once instead of stopping/joining threads sequentially #85

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bschwind
Copy link
Member

@bschwind bschwind commented Jul 4, 2024

Closes #12

Change-Id: Iaf8c28a18cf041f162f98e769f6b42f344285811
Copy link
Member

@goodhoko goodhoko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with two nits. Let's test this in portal. .)

Comment on lines +662 to +665
// Stopping actors in the reverse order in which they were spawned.
// We send the Stop control message to all actors first so they can
// all shut down in parallel, so actors will be in the process of
// stopping when we join the threads below.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tiny nit present simple, imperative form of comments

Suggested change
// Stopping actors in the reverse order in which they were spawned.
// We send the Stop control message to all actors first so they can
// all shut down in parallel, so actors will be in the process of
// stopping when we join the threads below.
// Stop actors in the reverse order in which they were spawned.
// Send the Stop control message to all actors first so they can
// all shut down in parallel, so actors will be in the process of
// stopping when we join the threads below.

let actor_name = entry.name();

if let Err(e) = entry.control_addr().send(Control::Stop) {
warn!("control channel is closed: {} ({})", actor_name, e);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preexisting, but It'd be nice to mention a context where this is happening and the consequence (to please @strohel). For instance:

Suggested change
warn!("control channel is closed: {} ({})", actor_name, e);
warn!("Couldn't send Control::Stop to {} to shut it down. Proceeding to shut down remaining actors: {}", actor_name, e);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new wording is confusing to me, the error message should come after the first sentence, not the second one. I'd just remove the "Proceeding" sentence.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My take:

Suggested change
warn!("control channel is closed: {} ({})", actor_name, e);
warn!("Couldn't send Control::Stop to {} to shut it down: {}. Ignoring and proceeding.", actor_name, e);

Copy link
Contributor

@mbernat mbernat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, the app crashes one second faster for me now!

let actor_name = entry.name();

if let Err(e) = entry.control_addr().send(Control::Stop) {
warn!("control channel is closed: {} ({})", actor_name, e);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new wording is confusing to me, the error message should come after the first sentence, not the second one. I'd just remove the "Proceeding" sentence.

Copy link
Contributor

@mbernat mbernat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC this is blocked until at least the panics in https://github.com/tonarino/portal/pull/3579 are fixed, so marking as request changes until then.

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.

Ideas to improve the speed of shutdown sequence
4 participants