• Stan Hu's avatar
    Fix uploader not returning 413 when artifact too large · a9abe0ab
    Stan Hu authored
    When an upload exceeds the maximum limit, `ErrEntityTooLarge` gets
    returned but is wrapped in multiple layers of errors when it is
    checked. As a result, when Google Cloud Storage were used to upload
    files, artifacts exceeding the maximum size would report a "500 Internal
    Server Error" instead of the correct "413 Request Entity Too Large"
    error message.
    
    To fix this, we check the state of `hardLimitReader` and set the error
    to `ErrEntityTooLarge` at the end of the `SaveFileFromReader` to ensure
    that this error will be returned.
    
    Closes https://gitlab.com/gitlab-org/gitlab-workhorse/-/issues/328
    a9abe0ab
sh-fix-gcs-entity-too-large.yml 105 Bytes