earl icon indicating copy to clipboard operation
earl copied to clipboard

Earl::Aplication on-exit behavior

Open RX14 opened this issue 7 years ago • 2 comments

On exit, Earl::Application calls terminate on all agents in the supervision tree, but does not wait for them to transition from stopping to stopped or crashed state. This leaves no time for agents to gracefully stop, should Earl::Application wait for itself to transition to stopped? Perhaps with a short timeout to terminate anyway.

RX14 avatar Sep 04 '18 17:09 RX14

Yes, exiting is still bad.

Alternatively, Supervisor and Pool could prevent the agents they spawn to outlive them? With Application eventually exiting anyway after a graceful time —or a second or third SIGINT is received.

ysbaddaden avatar Sep 05 '18 10:09 ysbaddaden

@ysbaddaden I agree with supervisors's children shouldn't outlive their parents. Reading the supervisor code, I think this is already handled well with the @done channel. The only missing piece is for Application to wait for call to exit.

I think application should have a graceful timeout and immediate exit on second SIGINT.

RX14 avatar Sep 05 '18 11:09 RX14