Files
swift-service-lifecycle/Sources/ServiceLifecycle
Franz Busch cdd6040d0d Fix logic issues during graceful shutdown (#171)
* Fix logic issues during graceful shutdown

# Motivation

This should fix the remaining issues raised in https://github.com/swift-server/swift-service-lifecycle/pull/166. The problem here was that if a service finished/threw out of order then we were wrongly treating this as if the service that we are currently shutting down finished.

# Modification
This PR ensures that we use the same `services` array during the graceful shutdown to nil out services that have finished. This way we correctly keep track of any service that finished. Additionally, there was a separate bug where we started to shutdown the next service to early if another service threw and had the termination behaviour of `shutdownGracefully`.

# Result
No more incorrect shutdown orderings.

* Fix one more race condition
2024-01-26 12:05:08 +00:00
..