devsisters / shardcake

Sharding and location transparency for Scala
https://devsisters.github.io/shardcake/
Apache License 2.0
382 stars 29 forks source link

Question about graceful shutdown #92

Closed BaekGeunYoung closed 11 months ago

BaekGeunYoung commented 11 months ago

hello, I want to implement graceful shutdown and it seems that we need to use terminateMessage of EntityManager. I think that once the termination message is offered to queue, then subsequent messages should not be enqueued, so that the function send can return EntityNotManagedByThisPod error after some retry. I can find out the code setting the state from Left[Queue] to Right[Signal] in terminateEntity, but not in terminateEntities. Is it intended? or the code should be fixed?

ghostdogpr commented 11 months ago

In the case of terminateEntities, it is done before in terminateEntitiesOnShards and terminateAllEntities where we remove those queues from the map entirely. No new queue will be created because isEntityOnLocalShards will return false in that case.

BaekGeunYoung commented 11 months ago

Aha thank you 😄