#4370 adjust upload offset and overwrite logic
Merged by tkopecek. Opened by mikem.
mikem/koji upload-fixes  into  master

Download 4370.patch

The Fedora instance ran into a situation where the code managed to leave a truncated upload without generating an error. Their case is unusual for a few reasons (multiple hubs behind reverse proxy, extremely high load from ai bots), but I think we can make the code somewhat better.

This PR makes a few adjustments to the overwrite logic and adds a number of tests.

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

While I can't be 100% sure, I'm fairly confident that my second theory on the linked issue is what happened (duplicate, delayed upload call handler). If that theory is correct, then this code should prevent similar truncations (see test_no_truncate)

unused import (koji.GenericError is used instead)

:thumbsup:

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-basic

1 new commit added

  • drop unused import in test

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

Commit c44a33ce fixes this pull-request

Pull-Request has been merged by tkopecek

Metadata