]> granicus.if.org Git - vim/commitdiff
patch 8.2.4699: hard to reproduce hang when reading from a channel v8.2.4699
authorLemonBoy <thatlemon@gmail.com>
Tue, 5 Apr 2022 21:03:30 +0000 (22:03 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 5 Apr 2022 21:03:30 +0000 (22:03 +0100)
Problem:    Hard to reproduce hang when reading from a channel.
Solution:   Check for readahead before starting to wait. (closes #10093,
            closes #7781, closes #6364)

src/channel.c
src/version.c

index 75fc89560ccc136d0161d08ceac89373c403c961..f8a8194374fa6d81c6ac96aec4d7c4135eb192e7 100644 (file)
@@ -3997,6 +3997,11 @@ channel_read_json_block(
            if (channel_parse_messages())
                continue;
 
+           // channel_parse_messages() may fill the queue with new data to
+           // process.
+           if (channel_has_readahead(channel, part))
+               continue;
+
            // Wait for up to the timeout.  If there was an incomplete message
            // use the deadline for that.
            timeout = timeout_arg;
index 23b2a1e2bcec19343ed9a9f5ea096cd9fdbf0a14..120633f0fa45518057e8858f875282f373e7bdc4 100644 (file)
@@ -746,6 +746,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4699,
 /**/
     4698,
 /**/