Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@genevieve
Copy link
Contributor

Fixes #240

cc @ljfranklin

Genevieve Lesperance and others added 11 commits December 3, 2018 17:08
- Update other dependencies

[#160181845]

Signed-off-by: Lyle Franklin <[email protected]>
- Allows us to reuse an object that has been dependency injected when we
do retries in upload product service for instance.

[#160181845]

Signed-off-by: Genevieve Lesperance <[email protected]>
- Otherwise we wrap it in a generic error type and can't detect if it's
something like io.EOF

[#160181845]

Signed-off-by: Lyle Franklin <[email protected]>
[#160181845]

Signed-off-by: Genevieve Lesperance <[email protected]>
- Something is closing the request body multiple times but having
  trouble finding it, just going to guard against it for now

[#160181845]
[#160181845] pivotal-cf/om #240: Intermittent `POST .../api/v0/available_products: EOF` when uploading tile
[#160181845] pivotal-cf/om #240: Intermittent `POST .../api/v0/available_products: EOF` when uploading tile
[#160181845]

Signed-off-by: Genevieve Lesperance <[email protected]>
- The upload handler required access to the server that the handler
belongs to. Added a channel to prevent trying to close the client
connections before the server had been initialized

[#160181845]

Signed-off-by: Genevieve Lesperance <[email protected]>
@jtarchie jtarchie self-requested a review December 7, 2018 14:37
@jtarchie
Copy link
Contributor

jtarchie commented Dec 7, 2018

@genevieve and @ljfranklin, I thought that this had been solved already a few months back. Are you all experiencing it again? If so, does this resolve the error for you in your pipeline?

@ljfranklin
Copy link
Contributor

@jtarchie no, our initial pass a while ago didn't help resolve the issue. More context here: #240 (comment). We haven't got a chance to put any mileage on this in our CI yet, but we were able to reproduce the error with an acceptance test included in the PR.

[#160181845] pivotal-cf/om #240: Intermittent `POST .../api/v0/available_products: EOF` when uploading tile
@ljfranklin
Copy link
Contributor

Just pushed one last commit to add the same retry logic to upload-stemcell as larger stemcells like vSphere might exhibit the same EOF error. I think we're ready for a review on this.

Some additional notes:

  • We initially tried to add a RetryClient or similar to handle this retrying transparently but this ended up being too difficult. Main problem was you have an io.Reader as the req.Body which can't be rewound in order to retry. We opted for adding the retry higher up in the command package and adding a Reset method on the formcontent struct.
  • Had to submit a PR to the uilive library as calling Stop() quickly followed by another Start() would sometimes panic: Allow Start to be called immediately after Stop gosuri/uilive#19. This hasn't been merged but that library is pretty low traffic so pointing at our fork doesn't seem terrible for now.
  • Had to touch a bunch of files in the api package to add errors.Wrap from github.com/pkg/errors. This allowed us to unwrap the error back to io.EOF back in the network package.
  • Had one other bit of weirdness where something was calling req.Body.Close() twice on retry which caused our progress bar to freak out because we call bar.Start() when the Body is closed. Tried to figure out where the multiple closes were coming from but ended up sidestepping it by modifying the progress ReadCloser to no-op on subsequent Close calls.

@fredwangwang
Copy link
Contributor

adding a Reset method on the formcontent struct.

I wanted to add that a while back but keeping forget... Nice work!

But meanwhile it seems still worth to investigate supproting resumable upload. Adding something like this into OpsManager and om would probably better solve the problem than retrying uploading the complete payload several times.

@ljfranklin
Copy link
Contributor

@fredwangwang @jtarchie could y'all give this a look when you get a chance? I agree resumable uploads would be great but getting the OpsMgr nginx config updated and backported to all supported versions seems like a tall order at this time.

@jtarchie jtarchie merged commit cc8f962 into master Dec 19, 2018
@jtarchie jtarchie deleted the fix-EOF-error branch December 19, 2018 22:34
@nbconklin
Copy link
Contributor

@genevieve @ljfranklin we merged this in, can y'all let us know if you continue to have any problems with this moving forward? thank you!

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.

6 participants