forked from msys2/MSYS2-packages
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #194 from git-for-windows/msys2-runtime-cbe555e054…
…cefeccd65250bb11dc56f82196301f msys2-runtime: update to cbe555e054cefeccd65250bb11dc56f82196301f
- Loading branch information
Showing
3 changed files
with
73 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
From cbe555e054cefeccd65250bb11dc56f82196301f Mon Sep 17 00:00:00 2001 | ||
From: Johannes Schindelin <johannes.schindelin@gmx.de> | ||
Date: Thu, 10 Oct 2024 19:52:47 +0200 | ||
Subject: [PATCH 52/N] Fix SSH hangs | ||
|
||
It was reported in https://github.com/git-for-windows/git/issues/5199 | ||
that as of v3.5.4, cloning or fetching via SSH is hanging indefinitely. | ||
|
||
Bisecting the problem points to 555afcb2f3 (Cygwin: select: set pipe | ||
writable only if PIPE_BUF bytes left, 2024-08-18). That commit's | ||
intention seems to look at the write buffer, and only report the pipe as | ||
writable if there are more than one page (4kB) available. | ||
|
||
However, the number that is looked up is the number of bytes that are | ||
already in the buffer, ready to be read, and further analysis | ||
shows that in the scenario described in the report, the number of | ||
available bytes is substantially below `PIPE_BUF`, but as long as they | ||
are not handled, there is apparently a dead-lock. | ||
|
||
Since the old logic worked, and the new logic causes a dead-lock, let's | ||
essentially revert 555afcb2f3 (Cygwin: select: set pipe writable only if | ||
PIPE_BUF bytes left, 2024-08-18). | ||
|
||
Note: This is not a straight revert, as the code in question has been | ||
modified subsequently, and trying to revert the original commit would | ||
cause merge conflicts. Therefore, the diff looks very different from the | ||
reverse diff of the commit whose logic is reverted. | ||
|
||
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> | ||
--- | ||
winsup/cygwin/select.cc | 6 +++--- | ||
1 file changed, 3 insertions(+), 3 deletions(-) | ||
|
||
diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc | ||
index bc02c3f..2c09b14 100644 | ||
--- a/winsup/cygwin/select.cc | ||
+++ b/winsup/cygwin/select.cc | ||
@@ -776,7 +776,7 @@ out: | ||
} | ||
ssize_t n = pipe_data_available (s->fd, fh, h, PDA_SELECT | PDA_WRITE); | ||
select_printf ("write: %s, n %d", fh->get_name (), n); | ||
- gotone += s->write_ready = (n >= PIPE_BUF); | ||
+ gotone += s->write_ready = (n > 0); | ||
if (n < 0 && s->except_selected) | ||
gotone += s->except_ready = true; | ||
} | ||
@@ -990,7 +990,7 @@ out: | ||
ssize_t n = pipe_data_available (s->fd, fh, fh->get_handle (), | ||
PDA_SELECT | PDA_WRITE); | ||
select_printf ("write: %s, n %d", fh->get_name (), n); | ||
- gotone += s->write_ready = (n >= PIPE_BUF); | ||
+ gotone += s->write_ready = (n > 0); | ||
if (n < 0 && s->except_selected) | ||
gotone += s->except_ready = true; | ||
} | ||
@@ -1416,7 +1416,7 @@ out: | ||
{ | ||
ssize_t n = pipe_data_available (s->fd, fh, h, PDA_SELECT | PDA_WRITE); | ||
select_printf ("write: %s, n %d", fh->get_name (), n); | ||
- gotone += s->write_ready = (n >= PIPE_BUF); | ||
+ gotone += s->write_ready = (n > 0); | ||
if (n < 0 && s->except_selected) | ||
gotone += s->except_ready = true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1e8cf1a59ae4e90396550cfe303ec13c0c5645ac | ||
cbe555e054cefeccd65250bb11dc56f82196301f |