Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions ractor/src/actor/actor_cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,12 @@ impl ActorCell {
///
/// * `status` - The [ActorStatus] to set
pub(crate) fn set_status(&self, status: ActorStatus) {
// The actor is shut down
if status == ActorStatus::Stopped || status == ActorStatus::Stopping {
// The actor is shut down — only run cleanup once, on the first transition
// to Stopping. This avoids redundant full-DashMap iterations on the
// Stopping → Stopped transition.
if (status == ActorStatus::Stopped || status == ActorStatus::Stopping)
&& self.get_status() < ActorStatus::Stopping
{
#[cfg(feature = "cluster")]
{
// stop monitoring for updates
Expand Down
Loading
Loading