Skip to content

Timeout while downloading branches #11265

Closed
@kevans91

Description

@kevans91

Hi,

This is something I intend to look at, but filing an issue for it in case others have thoughts; basically, for large repos/branches, downloading the branch may take a long time creating the .zip archive on the backend. There are actually two related issues here, that I think have the same solution:

1.) We may timeout on the download if the archive's not been created yet, and
2.) Gitea may handout an archive that's not yet complete

I think the solution is to push archiving into a queue and make this an async process that checks in for completion; then the download endpoint can check if archiving this particular commit/branch is in progress rather than handing out an incomplete archive.

This can be observed on lower-end hardware and/or with large repos, e.g. any of the branches here on my instance: https://git.kevans.dev/kevans/freebsd/branches/ -> these should all hit nginx's default timeout (and actually caused a DoS of sorts when people were apparently attempting to download one of my branches). I'd push it to try.gitea.io, but I think the problem is easily enough visualized to not need to push the ~2-4GB repo over there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/confirmedIssue has been reviewed and confirmed to be present or accepted to be implementedtype/enhancementAn improvement of existing functionality

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions