Skip to content

Commit

Permalink
Print more information when thread loops in read/write in net_serv.cc
Browse files Browse the repository at this point in the history
  • Loading branch information
montywi authored and vuvova committed May 27, 2024
1 parent 201e28f commit 153c917
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions sql/net_serv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit 153c917

Please sign in to comment.