From 75a0f3c011dfbafd2d60e87d4b2b07572df3e3ec Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Tue, 5 Apr 2022 22:03:30 +0100 Subject: [PATCH] patch 8.2.4699: hard to reproduce hang when reading from a channel 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 | 5 +++++ src/version.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/channel.c b/src/channel.c index 75fc89560..f8a819437 100644 --- a/src/channel.c +++ b/src/channel.c @@ -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; diff --git a/src/version.c b/src/version.c index 23b2a1e2b..120633f0f 100644 --- a/src/version.c +++ b/src/version.c @@ -746,6 +746,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 4699, /**/ 4698, /**/ -- 2.50.1