Tags: thejerf/suture
Tags
Do not examine the returned error for the context failure. Check the … …context directly. This closes Issue 77. Issue 77 is that returning one of the distinguished context errors as a service's error value caused the supervisor to intepret it as the context being cancelled. This is not necessarily the case; it is easy for another context, possibly a sub-context, to have its error bubble up to the service's return value. Since the supervisor has its own reference to the context, it should instead directly check if the context is canceled or not, rather than depending on the error return from the service.
Fix issue #35: Supervisor can't panic if stop is called before Serve. In hindsight, that's obvious. The contract is that Stop can be called before Serve, and the service ought to notice that and not start up in that case. Supervisors are not excluded from this policy.
Fix #34: Calling .Stop on a supervisor while trying to shut down serv… …ice will not lose service shutdown. When the supervisor shut down, the main loop is stopped and we go into a cleanup loop. That cleanup loop could not receive notifications that services sucessfully shut down, so it would delay until the timeout and report a failed shutdown.
PreviousNext