Skip to content

Commit

Permalink
Stopping an actors children should happen in reverse of spawning order
Browse files Browse the repository at this point in the history
  • Loading branch information
nightwolfz committed Nov 17, 2023
1 parent 291b4cf commit 3d941cb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions actor/actor_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -644,9 +644,10 @@ func (ctx *actorContext) stopAllChildren() {
return
}

ctx.extras.children.ForEach(func(_ int, pid *PID) {
ctx.Stop(pid)
})
var pids = ctx.extras.children.pids
for i := len(pids) - 1; i >= 0; i-- {
pids[i].sendSystemMessage(ctx.actorSystem, stopMessage)
}
}

func (ctx *actorContext) tryRestartOrTerminate() {
Expand Down

0 comments on commit 3d941cb

Please sign in to comment.