Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

poll: honor the timeout on Win32 #330

Merged
merged 1 commit into from
Mar 18, 2015
Merged

Conversation

ethomson
Copy link

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
Copy link
Author

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
Copy link

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

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.)
dscho added a commit that referenced this pull request Mar 18, 2015
poll: honor the timeout on Win32
@dscho dscho merged commit dd8b3ba into msysgit:master Mar 18, 2015
@dscho
Copy link
Member

dscho commented Mar 18, 2015

Thank you so much!

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

@ethomson
Copy link
Author

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

@dscho
Copy link
Member

dscho commented Mar 18, 2015

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

dscho added a commit to dscho/git that referenced this pull request Mar 18, 2015
This was originally 'pull request msysgit#330 from ethomson/poll_inftim' in
msysgit/git.

poll: honor the timeout on Win32

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@buildhive
Copy link

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

@kusma
Copy link
Member

kusma commented Mar 18, 2015

Good catch!

@buildhive
Copy link

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

@t-b
Copy link

t-b commented Mar 19, 2015

@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
Copy link
Member

dscho commented Mar 19, 2015

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

@t-b
Copy link

t-b commented Mar 20, 2015

@dscho Thanks. I"ve picked it.

dscho added a commit to dscho/git that referenced this pull request Mar 20, 2015
This was originally 'pull request msysgit#330 from ethomson/poll_inftim' in
msysgit/git.

poll: honor the timeout on Win32

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit to dscho/git that referenced this pull request Apr 1, 2015
This was originally 'pull request msysgit#330 from ethomson/poll_inftim' in
msysgit/git.

poll: honor the timeout on Win32

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho referenced this pull request in git-for-windows/git Apr 23, 2015
This was originally 'pull request #330 from ethomson/poll_inftim' in
msysgit/git.

poll: honor the timeout on Win32

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit to dscho/git that referenced this pull request Apr 29, 2015
This was originally 'pull request msysgit#330 from ethomson/poll_inftim' in
msysgit/git.

poll: honor the timeout on Win32

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho referenced this pull request in git-for-windows/git May 1, 2015
This was originally 'pull request #330 from ethomson/poll_inftim' in
msysgit/git.

poll: honor the timeout on Win32

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit to dscho/git that referenced this pull request May 14, 2015
This was originally 'pull request msysgit#330 from ethomson/poll_inftim' in
msysgit/git.

poll: honor the timeout on Win32

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit to dscho/git that referenced this pull request Jun 10, 2015
This was originally 'pull request msysgit#330 from ethomson/poll_inftim' in
msysgit/git.

poll: honor the timeout on Win32

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit to dscho/git that referenced this pull request Jun 17, 2015
This was originally 'pull request msysgit#330 from ethomson/poll_inftim' in
msysgit/git.

poll: honor the timeout on Win32

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho referenced this pull request in git-for-windows/git Jun 25, 2015
This was originally 'pull request #330 from ethomson/poll_inftim' in
msysgit/git.

poll: honor the timeout on Win32

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit to dscho/git that referenced this pull request Jul 18, 2015
This was originally 'pull request msysgit#330 from ethomson/poll_inftim' in
msysgit/git.

poll: honor the timeout on Win32

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit to dscho/git that referenced this pull request Jul 28, 2015
This was originally 'pull request msysgit#330 from ethomson/poll_inftim' in
msysgit/git.

poll: honor the timeout on Win32

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit to dscho/git that referenced this pull request Aug 30, 2015
This was originally 'pull request msysgit#330 from ethomson/poll_inftim' in
msysgit/git.

poll: honor the timeout on Win32

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit to dscho/git that referenced this pull request Sep 12, 2015
This was originally 'pull request msysgit#330 from ethomson/poll_inftim' in
msysgit/git.

poll: honor the timeout on Win32

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit to dscho/git that referenced this pull request Sep 18, 2015
This was originally 'pull request msysgit#330 from ethomson/poll_inftim' in
msysgit/git.

poll: honor the timeout on Win32

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants