Skip to content

Conversation

lrm29
Copy link
Contributor

@lrm29 lrm29 commented Jan 20, 2025

Closes #7090
Closes #7070

@ethomson
Copy link
Member

Hey @lrm29 - curious if this is ready for review? Is there anything that I can help with?

@lrm29 lrm29 marked this pull request as ready for review February 26, 2025 19:20
@lrm29
Copy link
Contributor Author

lrm29 commented Feb 26, 2025

Sorry, yes, I'm using this patch and think I would have heard of problems by now... I'm wary of not having test coverage for this in libgit2 itself (would be nice to be able to mock the server to be able to test the logic, rather than having to add a new test server).

It's clearly unusual to receive empty responses. It seems to be quite particular to a test Git server I've got running in a docker container, and tests against that pass with this patch.

There's more description of the issue in #7013.

@ethomson
Copy link
Member

Thanks! Wanted to check in because I've been ignoring it since it was marked as draft but it also looks correct and complete. I'll pull it in to a v1.9.1.

@nadavhaik
Copy link

Hi, when will this fix be reflected in pygit2?

@lrm29
Copy link
Contributor Author

lrm29 commented Jun 23, 2025

@ethomson, would be good to get this merged in if it passes review, seems to be more common than I originally thought.

@sdroege
Copy link

sdroege commented Jun 25, 2025

seems to be more common than I originally thought

Specifically, it affects all redirects from gitlab, both self-hosted as well as on gitlab.com.

I can confirm that this PR solves the problem.

EDIT: Specifically gitlab 18 is changing the behaviour to return an empty body, earlier versions had a little piece of HTML as response body

@nadavhaik
Copy link

Doesn't seem to reproduce anymore on python 3.12 + pygit2 1.18.2 + gitlab cloud. Is this fix already merged into pygit2?

@sdroege
Copy link

sdroege commented Aug 25, 2025

@nadavhaik gitlab reverted their change and now it provides a non-empty redirect response again

@ajeb78
Copy link

ajeb78 commented Aug 29, 2025

@nadavhaik gitlab reverted their change and now it provides a non-empty redirect response again

That's good to know. It's still just one service though: it doesn't seem beyond the realms of possibility that other services might return empty redirect responses in the future, so it still seems like a worthwhile fix given the impact it would have on projects using libgit2 with such a service.

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.

Massive libgit2 performance regression observed in Kubuntu 25.04 and Windows 11 Redirect with an empty body causes infinite hang
5 participants