Skip to content

Make sure we return after gracefully shutdown #170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 25, 2024

Conversation

FranzBusch
Copy link
Contributor

Motivation

After calling shutdownGracefully in our ServiceGroup we know that one of two things happened:

  1. We got an error so something went wrong
  2. We got no error so all services finished

In the 2. case, there might still be a few child tasks in the task group e.g. the graceful shutdown timeout task. We are currently still iterating the remaining child task results which might lead into unexpected fatal errors.

Modification

This PR makes sure that after we have successfully shutdown we are stopping iterating the child task results.

Result

No more unexpected fatal errors.

# Motivation

After calling `shutdownGracefully` in our `ServiceGroup` we know that one of two things happened:
1. We got an error so something went wrong
2. We got no error so all services finished

In the 2. case, there might still be a few child tasks in the task group e.g. the graceful shutdown timeout task. We are currently still iterating the remaining child task results which might lead into unexpected fatal errors.

# Modification
This PR makes sure that after we have successfully shutdown we are stopping iterating the child task results.

# Result
No more unexpected fatal errors.
@FranzBusch FranzBusch force-pushed the fb-fix-graceful-shutdown-signal branch from c0efd9c to 4822be5 Compare January 24, 2024 20:01
@FranzBusch FranzBusch enabled auto-merge (squash) January 25, 2024 13:44
@FranzBusch
Copy link
Contributor Author

@swift-server-bot test this please

@FranzBusch FranzBusch force-pushed the fb-fix-graceful-shutdown-signal branch from 58db08a to c3cb5ff Compare January 25, 2024 14:14
@FranzBusch FranzBusch merged commit 0907d4a into main Jan 25, 2024
@FranzBusch FranzBusch deleted the fb-fix-graceful-shutdown-signal branch January 25, 2024 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants