Skip to content

Fix write after close on http response - #10244

Merged
icecrime merged 2 commits into
moby:masterfrom
dmcgowan:registry-panic-fix
Jan 22, 2015
Merged

icecrime merged 2 commits into
moby:masterfrom
dmcgowan:registry-panic-fix

Conversation

@dmcgowan

Copy link
Copy Markdown
Member

Address #10228 but is not a confirmed fix

Both solutions should be valid and fix a possible panic caused by writing to an http.Response after the response has been finalized. The fix in streams could fix a wider range of panics. The registry fix is targeting a specific panic caused by a close on the progressreader being called by the network connection. The NopCloser will prevent the network connection from being able to close the progressreader, which in turns attempts a flush on a writer bound to the http.Response to the client.

@icecrime icecrime added this to the 1.5.0 milestone Jan 21, 2015
@stevvooe

Copy link
Copy Markdown
Contributor

This PR should fix the panic but may be susceptible to leaking the ProgressReader (I am not really sure whether it will be garbage collected or not). I'm going to update this with a few commits that should shut this issue down.

dmcgowan and others added 2 commits January 21, 2015 15:14
@LK4D4

LK4D4 commented Jan 22, 2015

Copy link
Copy Markdown
Contributor

drone failed

@dmcgowan

Copy link
Copy Markdown
Member Author

This panic was also trigger on a v1 registry #9913

Configured nginx in the same way but yet to get a panic

@stevvooe

Copy link
Copy Markdown
Contributor

@icecrime @jfrazelle I am going to back out the FlushingWriter changes to see if that clears up the tests.

@LK4D4

LK4D4 commented Jan 22, 2015

Copy link
Copy Markdown
Contributor

Okay, I don't see harm in this PR. Also it is probably fixes pretty bad crashes :)
LGTM

@icecrime

Copy link
Copy Markdown
Contributor

Agreed: I see no harm, only potential fixes. LGTM

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.

4 participants