From 153c9173eaa09e1a4b7a64debff5aa0dfdbbc23a Mon Sep 17 00:00:00 2001 From: Monty Date: Mon, 26 Feb 2024 12:01:42 +0200 Subject: [PATCH] Print more information when thread loops in read/write in net_serv.cc --- sql/net_serv.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sql/net_serv.cc b/sql/net_serv.cc index d8bfc8d312fbd..90bf4ef3d7dc5 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -702,8 +702,9 @@ net_real_write(NET *net,const uchar *packet, size_t len) if (retry_count++ < net->retry_count) continue; } - EXTRA_DEBUG_fprintf(stderr, "%s: write looped, aborting thread\n", - my_progname); + EXTRA_DEBUG_fprintf(stderr, + "%s: write looped on vio with state %d, aborting thread\n", + my_progname, (int) net->vio->type); net->error= 2; /* Close socket */ net->last_errno= (interrupted ? ER_NET_WRITE_INTERRUPTED : ER_NET_ERROR_ON_WRITE); @@ -857,8 +858,9 @@ static ulong my_real_read(NET *net, size_t *complen, if (vio_should_retry(net->vio) && retry_count++ < net->retry_count) continue; EXTRA_DEBUG_fprintf(stderr, - "%s: read looped with error %d, aborting thread\n", - my_progname, vio_errno(net->vio)); + "%s: read looped with error %d on vio with state %d, " + "aborting thread\n", + my_progname, vio_errno(net->vio), (int) net->vio->type); DBUG_PRINT("error", ("Couldn't read packet: remain: %u errno: %d length: %ld", remain, vio_errno(net->vio), (long) length));