Skip to content

Commit 2cde059

Browse files
authored
Handle EAGAIN in clusterWriteHandler (valkey-io#3421)
To avoid freeing the cluster link when EAGAIN occurs, so that we can try again and keeping the send messages. Signed-off-by: Binbin <binloveplay1314@qq.com>
1 parent cf05c0d commit 2cde059

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/cluster_legacy.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4477,6 +4477,7 @@ void clusterWriteHandler(connection *conn) {
44774477

44784478
nwritten = connWrite(conn, (char *)msg + msg_offset, msg_len - msg_offset);
44794479
if (nwritten <= 0) {
4480+
if (nwritten == -1 && connGetState(conn) == CONN_STATE_CONNECTED) return; /* equivalent to EAGAIN */
44804481
serverLog(LL_DEBUG, "I/O error writing to node link: %s",
44814482
(nwritten == -1) ? connGetLastError(conn) : "short write");
44824483
handleLinkIOError(link);

0 commit comments

Comments
 (0)