session.c : session_alloc
If backend connection can't be created, backend_dcb is not create, router client session is not created and what already is created in session_alloc, is freed. mysql_client.c : gw_read_client_event If session creation failed, then - instead of sending ok to client, "failed to create new session" is sent and client dcb is closed. : gw_MySQLAccept removed loop where accept was called again and again. With single thread looping forever is not possible because there's no one to free previously allocated resources. If accept fails ten times in a row, then return without new client dcb.
This commit is contained in:
@ -569,6 +569,9 @@ int gw_do_connect_to_backend(
|
||||
if (eno == EINPROGRESS) {
|
||||
rv = 1;
|
||||
} else {
|
||||
int rc;
|
||||
int oldfd = so;
|
||||
|
||||
skygw_log_write_flush(
|
||||
LOGFILE_ERROR,
|
||||
"%lu [gw_do_connect_to_backend] Failed to "
|
||||
@ -580,7 +583,20 @@ int gw_do_connect_to_backend(
|
||||
eno,
|
||||
strerror(eno));
|
||||
/** Close newly created socket. */
|
||||
close(so);
|
||||
rc = close(so);
|
||||
|
||||
if (rc != 0) {
|
||||
int eno = errno;
|
||||
errno = 0;
|
||||
skygw_log_write_flush(
|
||||
LOGFILE_ERROR,
|
||||
"%lu [gw_do_connect_to_backend] Failed to "
|
||||
"close socket %d due %d, %s.",
|
||||
pthread_self(),
|
||||
oldfd,
|
||||
eno,
|
||||
strerror(eno));
|
||||
}
|
||||
goto return_rv;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user