log_manager.cc:
State update for filewriter was missing and that caused Maxscale to fail if opening of any log file failed. dcb.c: Added EAGAIN and EWOULDBLOCK handling to dcb_read. If dcb_close is called for freshly created dcb, dcb is only freed. gateway.c: Added file_write_footer and write_footer of which the latter is called at exit time. It simply draws a line to screen. gw_utils.c: Some macros for helping comparison between gw_read_gwbuff and dcb_read, which overlap. poll.c: Some macros to help enable/disable mutexing in poll_waitevents service.c: Check return value of listen and session_alloc and behave accordingly. mysql_client.c: If ioctl returned successfully with b==0 it earlier caused closing the client and backend dcbs. Since that doesn't reliably indicate that client has closed socket on its side, Maxscale doesn't close its sockets either. mysql_common.c: In gw_receive_backend_auth, if dcb_read returns n==0, it is not considered as an error anymore. The implemented behavior is not yet complete and correct. Result should be successful but the protocol state shouldn't change to MYSQL_IDLE before backend return is received. In gw_send_authentication_to_backend protocol state was always set to MYSQL_AUTH_RECV even if gw_rwite had failed. Now, return value is read and state is set in caller's context basen on the return value. skygw_utils.cc: Removed ss_dassert from skyge_file_init because it prevented from returning meaningful error meassage to the client.:
This commit is contained in:
@ -295,7 +295,7 @@ return_succp:
|
||||
if (err != 0) {
|
||||
/** This releases memory of all created objects */
|
||||
logmanager_done_nomutex();
|
||||
fprintf(stderr, "Initializing logmanager failed.\n");
|
||||
fprintf(stderr, "* Initializing logmanager failed.\n");
|
||||
}
|
||||
return succp;
|
||||
}
|
||||
@ -896,7 +896,7 @@ int skygw_log_enable(
|
||||
bool err = 0;
|
||||
|
||||
if (!logmanager_register(true)) {
|
||||
fprintf(stderr, "ERROR: Can't register to logmanager\n");
|
||||
//fprintf(stderr, "ERROR: Can't register to logmanager\n");
|
||||
err = -1;
|
||||
goto return_err;
|
||||
}
|
||||
@ -918,7 +918,7 @@ int skygw_log_disable(
|
||||
bool err = 0;
|
||||
|
||||
if (!logmanager_register(true)) {
|
||||
fprintf(stderr, "ERROR: Can't register to logmanager\n");
|
||||
//fprintf(stderr, "ERROR: Can't register to logmanager\n");
|
||||
err = -1;
|
||||
goto return_err;
|
||||
}
|
||||
@ -961,7 +961,7 @@ static bool logfile_set_enabled(
|
||||
notused);
|
||||
if (err != 0) {
|
||||
fprintf(stderr,
|
||||
"Writing to logfile %s failed.\n",
|
||||
"* Writing to logfile %s failed.\n",
|
||||
STRLOGID(LOGFILE_ERROR));
|
||||
}
|
||||
ss_dassert(false);
|
||||
@ -1010,7 +1010,7 @@ int skygw_log_write_flush(
|
||||
size_t len;
|
||||
|
||||
if (!logmanager_register(true)) {
|
||||
fprintf(stderr, "ERROR: Can't register to logmanager\n");
|
||||
//fprintf(stderr, "ERROR: Can't register to logmanager\n");
|
||||
err = -1;
|
||||
goto return_err;
|
||||
}
|
||||
@ -1063,7 +1063,7 @@ int skygw_log_write(
|
||||
size_t len;
|
||||
|
||||
if (!logmanager_register(true)) {
|
||||
fprintf(stderr, "ERROR: Can't register to logmanager\n");
|
||||
//fprintf(stderr, "ERROR: Can't register to logmanager\n");
|
||||
err = -1;
|
||||
goto return_err;
|
||||
}
|
||||
@ -1629,6 +1629,7 @@ static void filewriter_done(
|
||||
id = (logfile_id_t)i;
|
||||
skygw_file_done(fw->fwr_file[id]);
|
||||
}
|
||||
fw->fwr_state = DONE;
|
||||
case DONE:
|
||||
case UNINIT:
|
||||
default:
|
||||
|
Reference in New Issue
Block a user