Skip to content

Commit 392d317

Browse files
committed
Treat ECONNRESET as standard Disconnects (#2291)
(cherry picked from commit 4a1cd0f)
1 parent 8695b9d commit 392d317

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/rdkafka_transport.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,8 @@ rd_kafka_transport_socket_recvmsg (rd_kafka_transport_t *rktrans,
271271
if (unlikely(r <= 0)) {
272272
if (r == -1 && socket_errno == EAGAIN)
273273
return 0;
274-
else if (r == 0) {
274+
else if (r == 0 ||
275+
(r == -1 && socket_errno == ECONNRESET)) {
275276
/* Receive 0 after POLLIN event means
276277
* connection closed. */
277278
rd_snprintf(errstr, errstr_size, "Disconnected");

0 commit comments

Comments
 (0)