Skip to content

Commit

Permalink
Bug #30755992: MYSQL DUMP "SUFFICIENTLY LONG" NETWORK TIMEOUT TOO SHORT
Browse files Browse the repository at this point in the history
RB#23667

Increased the hard-coded network timeout from 700 secs to 86400 (1 day
in seconds).
The rationale is that it has to be big enough. One day is big enough for
everybody. But not infinite.
  • Loading branch information
gkodinov committed Jan 13, 2020
1 parent 910ba98 commit 1f90fad
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions client/mysqldump.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
Expand Down Expand Up @@ -1520,7 +1520,7 @@ static int connect_to_db(char *host, char *user, char *passwd) {
&opt_zstd_compress_level);

if (opt_network_timeout) {
uint timeout = 700;
uint timeout = 86400; // 1 day in seconds
ulong max_packet_allowed = 1024L * 1024L * 1024L;

mysql_options(&mysql_connection, MYSQL_OPT_READ_TIMEOUT, (char *)&timeout);
Expand Down Expand Up @@ -1597,8 +1597,8 @@ static int connect_to_db(char *host, char *user, char *passwd) {
*/
if (opt_network_timeout) {
snprintf(buff, sizeof(buff),
"SET SESSION NET_READ_TIMEOUT= 700, "
"SESSION NET_WRITE_TIMEOUT= 700 ");
"SET SESSION NET_READ_TIMEOUT= 86400, "
"SESSION NET_WRITE_TIMEOUT= 86400 "); // 1 day in seconds
if (mysql_query_with_error_report(mysql, 0, buff)) return 1;
}

Expand Down

0 comments on commit 1f90fad

Please sign in to comment.