Skip to content
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

fix: close() deadlock #345

Merged
merged 2 commits into from
Aug 21, 2020
Merged

fix: close() deadlock #345

merged 2 commits into from
Aug 21, 2020

Conversation

ronag
Copy link
Member

@ronag ronag commented Aug 19, 2020

When no resume is going to be scheduled, request.onError might never be detected or in the case of Client.pipeline the stream destroy.

See test case in first commit, adb4fae.

Fixes: #344


There is a problem with the existing API where if a running request is aborted while the server is not providing any data nothing is ticking the state machine.

There are some API changes:

  • A new hook is added on dispatch handler, onConnect(abort).

  • onData now only returns a boolean (no magical null).

@ronag

This comment has been minimized.

@ronag ronag added the bug Something isn't working label Aug 19, 2020
When no resume is going to be scheduled, request.onError might
never be detected.

Fixes: #344
@ronag ronag added the semver-major Features or fixes that will be included in the next semver major release label Aug 20, 2020
@ronag ronag requested review from mcollina and removed request for mcollina August 20, 2020 19:47
@ronag ronag force-pushed the close-deadlock branch 9 times, most recently from d1f6423 to 596eca7 Compare August 20, 2020 20:09
@ronag ronag requested a review from mcollina August 20, 2020 20:09
@ronag ronag marked this pull request as ready for review August 20, 2020 20:09
@ronag ronag force-pushed the close-deadlock branch 4 times, most recently from 9ff2abb to d1dfee2 Compare August 20, 2020 20:16
@ronag
Copy link
Member Author

ronag commented Aug 20, 2020

Some todos and tests remain to be sorted. I'll look into those if this gets preliminary approval.

@ronag ronag force-pushed the close-deadlock branch 3 times, most recently from 48c3059 to 61eda9a Compare August 20, 2020 20:25
lib/client.js Outdated Show resolved Hide resolved
lib/client.js Outdated Show resolved Hide resolved
lib/client.js Outdated Show resolved Hide resolved
@ronag ronag force-pushed the close-deadlock branch 6 times, most recently from 67c3e7d to ea4dad6 Compare August 20, 2020 22:27
@ronag ronag marked this pull request as draft August 20, 2020 22:36
@ronag

This comment has been minimized.

@ronag ronag force-pushed the close-deadlock branch 14 times, most recently from c24af1a to c9395eb Compare August 20, 2020 23:22
@ronag ronag marked this pull request as ready for review August 20, 2020 23:25
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcollina
Copy link
Member

Really good work @ronag!

@ronag ronag merged commit 9286342 into master Aug 21, 2020
@ronag ronag deleted the close-deadlock branch August 21, 2020 08:15
ronag added a commit that referenced this pull request Aug 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working semver-major Features or fixes that will be included in the next semver major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

close deadlock if pipeline inactive
2 participants