listen: Turn off CLIENT_MAX_WAIT_SECS
The idea behind this feature was to avoid the client thread in a listen server getting stuck forever if the mirroring thread in the source died. However, it breaks any sane implementation of max_Bps in that thread, and there are lingering concerns over how it might operate under normal conditions anyway. Specifically, if iterating over the bitmap takes a long time, or even just reading the requisite 8MB from the disc in order to send it, then the 5-second timeout could be hit, causing mirroring to fail unnecessarily.
This commit is contained in:
15
src/client.c
15
src/client.c
@@ -192,14 +192,19 @@ int client_read_request( struct client * client , struct nbd_request *out_reques
|
||||
|
||||
struct nbd_request_raw request_raw;
|
||||
fd_set fds;
|
||||
struct timeval tv = {CLIENT_MAX_WAIT_SECS, 0};
|
||||
struct timeval * ptv;
|
||||
struct timeval * ptv = NULL;
|
||||
int fd_count;
|
||||
|
||||
/* We want a timeout if this is an inbound migration, but not
|
||||
* otherwise
|
||||
/* We want a timeout if this is an inbound migration, but not otherwise.
|
||||
* This is compile-time selectable, as it will break mirror max_bps
|
||||
*/
|
||||
ptv = server_is_in_control( client->serve ) ? NULL : &tv;
|
||||
#ifdef HAS_LISTEN_TIMEOUT
|
||||
struct timeval tv = {CLIENT_MAX_WAIT_SECS, 0};
|
||||
|
||||
if ( !server_is_in_control( client->serve ) ) {
|
||||
ptv = &tv;
|
||||
}
|
||||
#endif
|
||||
|
||||
FD_ZERO(&fds);
|
||||
FD_SET(client->socket, &fds);
|
||||
|
Reference in New Issue
Block a user