Skip to content

TaskHandler state can be reset after error #297

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

Closed
artemredkin opened this issue Aug 21, 2020 · 0 comments · Fixed by #298
Closed

TaskHandler state can be reset after error #297

artemredkin opened this issue Aug 21, 2020 · 0 comments · Fixed by #298
Assignees
Labels
kind/bug Feature doesn't work as expected.
Milestone

Comments

@artemredkin
Copy link
Collaborator

.endOrError should be terminal state

@artemredkin artemredkin added the kind/bug Feature doesn't work as expected. label Aug 21, 2020
@artemredkin artemredkin added this to the 1.2.1 milestone Aug 21, 2020
@artemredkin artemredkin self-assigned this Aug 21, 2020
artemredkin added a commit to artemredkin/async-http-client that referenced this issue Aug 21, 2020
Motivation:
Right now if task handler encounters an error, it changes state to
`.endOrError`. We gate on that state to make sure that we do not
process errors in the pipeline twice. Unfortunately, that state
can be reset when we upload body or receive response parts.

Modifications:
Adds state validation before state is updated to a new value
Adds a test

Result:
Fixes swift-server#297
artemredkin added a commit to artemredkin/async-http-client that referenced this issue Aug 21, 2020
Motivation:
Right now if task handler encounters an error, it changes state to
`.endOrError`. We gate on that state to make sure that we do not
process errors in the pipeline twice. Unfortunately, that state
can be reset when we upload body or receive response parts.

Modifications:
Adds state validation before state is updated to a new value
Adds a test

Result:
Fixes swift-server#297
artemredkin added a commit to artemredkin/async-http-client that referenced this issue Aug 24, 2020
Motivation:
Right now if task handler encounters an error, it changes state to
`.endOrError`. We gate on that state to make sure that we do not
process errors in the pipeline twice. Unfortunately, that state
can be reset when we upload body or receive response parts.

Modifications:
Adds state validation before state is updated to a new value
Adds a test

Result:
Fixes swift-server#297
artemredkin added a commit to artemredkin/async-http-client that referenced this issue Aug 24, 2020
Motivation:
Right now if task handler encounters an error, it changes state to
`.endOrError`. We gate on that state to make sure that we do not
process errors in the pipeline twice. Unfortunately, that state
can be reset when we upload body or receive response parts.

Modifications:
Adds state validation before state is updated to a new value
Adds a test

Result:
Fixes swift-server#297
artemredkin added a commit that referenced this issue Aug 24, 2020
* fail if we get part when state is endOrError

* Prevent TaskHandler state change after `.endOrError`

Motivation:
Right now if task handler encounters an error, it changes state to
`.endOrError`. We gate on that state to make sure that we do not
process errors in the pipeline twice. Unfortunately, that state
can be reset when we upload body or receive response parts.

Modifications:
Adds state validation before state is updated to a new value
Adds a test

Result:
Fixes #297
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Feature doesn't work as expected.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant