Skip to content

Conversation

@oliveroneill
Copy link
Contributor

There is a race condition in start() where setting the state to running can happen after the background task starts. The first thing this task does is guard strongSelf.operating else { return } which will fail is the state is not running. If the background task starts before the state is set then the background task will exit and the server will not respond.

I've fixed this by setting the state to running before creating the background task. Alternatively we can set the state within the background task.

There is a race condition where the state may not be set before the
async task checks its value. This causes the server to shutdown
with no warning. This change will fix this bug.
@damian-kolakowski damian-kolakowski merged commit b332956 into httpswift:stable Jun 7, 2018
tomieq pushed a commit to tomieq/swifterfork that referenced this pull request Apr 1, 2021
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