Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix librepo isn't able to load zchunk files from next server on failure #151

Merged

Conversation

jdieter
Copy link
Contributor

@jdieter jdieter commented May 11, 2019

Zchunk uses a simple state machine in librepo to determine where it's at
in the download process (is it downloading the header or the body).

The yandex.ru mirror will fail if more than one range is in a request, but
fails in a nonstandard way. librepo catches the failure and moves on to
the next mirror, but truncates the downloaded zchunk header. This causes
the state machine to be out of sync with reality.

I've fixed this by only truncating the zchunk header if the state machine is
in the header download state, which means that the next mirror will only
download any missing chunks. Zchunk will only download missing or
corrupted chunks, so this also gives us automatic resume on zchunk
metadata downloads.

See https://bugzilla.redhat.com/show_bug.cgi?id=1706321 for the initial bug
report. Please pull this into F30, as our Russian users are running into
problems because of this bug.

Zchunk uses a simple state machine in librepo to determine where it's at
in the download process (is it downloading the header or the body).

The yandex.ru mirror will fail if more than one range is in a request, but
fails in a nonstandard way.  librepo catches the failure and moves on to
the next mirror, but truncates the downloaded zchunk header.  This causes
the state machine to be out of sync with reality.

I've fixed this by only truncating a zchunk header if the state machine is
in the header download state, which means that the next mirror will only
download any missing chunks.  Zchunk will only download missing or
corrupted chunks, so this also gives us automatic resume on zchunk
metadata downloads.

Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
@Conan-Kudo Conan-Kudo merged commit 76c833e into rpm-software-management:master May 12, 2019
@jdieter jdieter deleted the fix-next-server-zchunk branch June 13, 2019 21:01
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.

None yet

2 participants