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

downloader: when retry but can't resume, retry the whole file #3457

Closed
wants to merge 1 commit into from

Conversation

domenkozar
Copy link
Member

@domenkozar domenkozar commented Mar 30, 2020

I'm not sure I fully understand how code works, but I assume init is called for each retry and this is the correct way to sync up warn and the actual behavior of resuming.

Fixes #3278

I'd appreciate a maintenance release since a lot of users of Cachix are hitting this occasionally.

@edolstra
Copy link
Member

I'm not sure this is correct. If we've already written to a sink, then we can't do a retry because we would end up writing the same data twice. Otherwise we get errors like "error 9 while decompressing xz file". (See 53247d6.)

@domenkozar
Copy link
Member Author

Seems like CI fails due to e322a16

@domenkozar
Copy link
Member Author

@edolstra is there any way to reset the sink?

@edolstra
Copy link
Member

No. But if ranged requests are unavailable, we could discard the first n bytes (where n is the number of bytes previously written to the sink).

@domenkozar
Copy link
Member Author

Couldn't download raise an exception so that the caller would setup the sink again?

@edolstra
Copy link
Member

That was what 78fa47a tried to do but it was a lot more complicated.

@domenkozar
Copy link
Member Author

Actually, we should prevent from connecting the sink until we assert response status code is 2xx

@edolstra
Copy link
Member

edolstra commented Apr 6, 2020

@domenkozar But the status code already is 2xx. The problem is that the transmission of the body gets interrupted.

@domenkozar
Copy link
Member Author

I'm not so sure, #3278 is 504 and I've seen reports with 526 Invalid SSL Certificate, so I'm a bit puzzled why those are not retried if the body wasn't consumed (and if it was 200, status code wouldn't be able to change?).

@edolstra
Copy link
Member

edolstra commented Apr 6, 2020

Hm, it's possible writeCallback is called with the 5xx body.

@domenkozar
Copy link
Member Author

Going to continue in #3278

@domenkozar domenkozar closed this Apr 7, 2020
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.

504 was not retried while fetching nar
2 participants