msysgit / git

msysGit-based Git for Windows 1.x is now superseded by Git for Windows 2.x
http://github.com/git-for-windows/git
Other
1.01k stars 316 forks source link

poll: honor the timeout on Win32 #330

Closed ethomson closed 9 years ago

ethomson commented 9 years ago

Ensure that when passing a pipe, the gnulib poll replacement will not return 0 before the timeout has passed.

Not obeying the timeout (and merely returning 0) causes pathological behavior when preparing a packfile for a repository and taking a long time to do so. If poll were to return 0 immediately, this would cause keep-alives to get sent as quickly as possible until the packfile was created. Such deviance from the standard would cause megabytes (or more) of keep-alive packets to be sent.

GetTickCount is used as it is efficient, stable and monotonically increasing. (Neither GetSystemTime nor QueryPerformanceCounter have all three of these properties.)

ethomson commented 9 years ago

For additional background, see http://lists.gnu.org/archive/html/bug-gnulib/2014-09/msg00045.html.

Please note the updated patch later in the thread (http://lists.gnu.org/archive/html/bug-gnulib/2014-09/msg00070.html) which is what was cherry-picked here.

buildhive commented 9 years ago

MSysGit - the development behind Git for Windows » git #277 SUCCESS This pull request looks good (what's this?)

dscho commented 9 years ago

Thank you so much!

Do you want a new 1.9.5.msysgit.1 release with this?

ethomson commented 9 years ago

Nope! I'm in no hurry, I'm happy to use a locally patched build. Thanks! :)

dscho commented 9 years ago

Okay, then I'll forward port this patch to the upcoming MSys2-based Git for Windows.

buildhive commented 9 years ago

MSysGit - the development behind Git for Windows » git #278 SUCCESS This pull request looks good (what's this?)

kusma commented 9 years ago

Good catch!

buildhive commented 9 years ago

MSysGit - the development behind Git for Windows » git #279 SUCCESS This pull request looks good (what's this?)

t-b commented 9 years ago

@ethomson @dscho Is this patch safe to include into maint-1.9? If yes I would just cherry-pick without PR. Due to the openssl security bugs I'm currently preparing a 1.9.5.msysgit.1 release.

dscho commented 9 years ago

@t-b yes, it is safe to pick. Thank you!

t-b commented 9 years ago

@dscho Thanks. I"ve picked it.