Cleanup actor mailbox messages on destroy
This commit is contained in:
parent
3a7a5ed669
commit
78d3a97dd0
@ -237,8 +237,14 @@ public final class TbActorMailbox implements TbActorCtx {
|
|||||||
try {
|
try {
|
||||||
ready.set(NOT_READY);
|
ready.set(NOT_READY);
|
||||||
actor.destroy(stopReason, cause);
|
actor.destroy(stopReason, cause);
|
||||||
highPriorityMsgs.forEach(msg -> msg.onTbActorStopped(stopReason));
|
highPriorityMsgs.removeIf(msg -> {
|
||||||
normalPriorityMsgs.forEach(msg -> msg.onTbActorStopped(stopReason));
|
msg.onTbActorStopped(stopReason);
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
normalPriorityMsgs.removeIf(msg -> {
|
||||||
|
msg.onTbActorStopped(stopReason);
|
||||||
|
return true;
|
||||||
|
});
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
log.warn("[{}] Failed to destroy actor: ", selfId, t);
|
log.warn("[{}] Failed to destroy actor: ", selfId, t);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user