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

should fix issue where 'read on closed body' error was leaking down #1540

Merged
merged 1 commit into from
Jul 29, 2015

Conversation

whyrusleeping
Copy link
Member

This should address the issues seen here: https://travis-ci.org/ipfs/go-ipfs/jobs/73239014#L3661

I had special cased the error in one spot earlier where this error is always hit, but in cases where we pass the reader back directly, its a bit of a race on whether the final read happens before or after the body is closed. This embeds the error check into the reader wrapping the body so we always get that error checked properly and converted into an io.EOF

License: MIT
Signed-off-by: Jeromy jeromyj@gmail.com

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
@jbenet jbenet added the status/in-progress In progress label Jul 29, 2015
// reading on a closed response body is as good as an io.EOF here
if err != nil && strings.Contains(err.Error(), "read on closed response body") {
err = io.EOF
}
Copy link
Member

Choose a reason for hiding this comment

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

@zignig was this what you were seeing? "read on closed response body"

@jbenet
Copy link
Member

jbenet commented Jul 29, 2015

@whyrusleeping this LGTM 👍 any known way to repro the error? (for a test case)

@jbenet
Copy link
Member

jbenet commented Jul 29, 2015

LGTM but not to travis. looks like a lot of bad luck. rerunning

jbenet added a commit that referenced this pull request Jul 29, 2015
should fix issue where 'read on closed body' error was leaking down
@jbenet jbenet merged commit 90d1b8e into master Jul 29, 2015
@jbenet jbenet removed the status/in-progress In progress label Jul 29, 2015
@jbenet jbenet deleted the fix/read-closed-body branch July 29, 2015 22:20
@whyrusleeping
Copy link
Member Author

@jbenet yeah, i couldnt figure out how to get it to repro on my computer sadly.

@jbenet jbenet added this to the IPFS 0.3.6 milestone Jul 29, 2015
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.

None yet

2 participants