#3269 return 400 codes when client fails to send a full request
Merged by tkopecek. Opened by mikem.
mikem/koji client-read-errors  into  master

Download 3269.patch

Fixes: https://pagure.io/koji/issue/3268

When we return an http 400 code instead of a fault, the client will retry the call if it has retries enabled. The only fault that is retried is ServerOffline and that does not seem appropriate here.

1 new commit added

  • fix indent

1 new commit added

  • also raise 400 errors when we can't read the client upload stream

Upon further testing, I realized the initial version of this PR did not address upload calls. The new commit extends the change to cover that as well.

This works well for me locally. If I simulate the OSErrors, the client upload code will retry.

Retrying an upload call that may have partially written the chunk might seem iffy, but each successive retry call is writing the same content to the same offset and the fastUpload code will perform an extra verify at the end if there are any retries (and it has always done so).

Metadata Update from @jobrauer:
- Pull-request tagged with: testing-ready

Metadata Update from @jobrauer:
- Pull-request tagged with: testing-done

Commit f5fe7a55 fixes this pull-request

Pull-Request has been merged by tkopecek

Metadata