diff --git a/server/core/gateway.cc b/server/core/gateway.cc index 06b15b841..edbc4573c 100644 --- a/server/core/gateway.cc +++ b/server/core/gateway.cc @@ -2248,8 +2248,6 @@ return_main: unlink_pidfile(); } - mxs_log_flush_sync(); - if (daemon_mode && rc != MAXSCALE_SHUTDOWN) { /** Notify the parent process that an error has occurred */ diff --git a/server/core/maxkeys.c b/server/core/maxkeys.c index c123a7428..613fd1cd3 100644 --- a/server/core/maxkeys.c +++ b/server/core/maxkeys.c @@ -109,7 +109,6 @@ int main(int argc, char **argv) rval = EXIT_FAILURE; } - mxs_log_flush_sync(); mxs_log_finish(); return rval; diff --git a/server/core/maxpasswd.c b/server/core/maxpasswd.c index b9f006ed6..ee0f0b7a4 100644 --- a/server/core/maxpasswd.c +++ b/server/core/maxpasswd.c @@ -192,7 +192,6 @@ int main(int argc, char **argv) rval = EXIT_FAILURE; } - mxs_log_flush_sync(); mxs_log_finish(); return rval; diff --git a/server/core/test/test_hint.cc b/server/core/test/test_hint.cc index aaa137c93..eb84632b7 100644 --- a/server/core/test/test_hint.cc +++ b/server/core/test/test_hint.cc @@ -40,7 +40,6 @@ * test1 Allocate table of users and mess around with it * */ -int mxs_log_flush_sync(void); static int test1() { @@ -52,7 +51,6 @@ test1() char* name = MXS_STRDUP_A("name"); hint = hint_create_parameter(NULL, name, "value"); MXS_FREE(name); - mxs_log_flush_sync(); ss_info_dassert(NULL != hint, "New hint list should not be null"); ss_info_dassert(0 == strcmp("value", (char*)hint->value), "Hint value should be correct"); ss_info_dassert(0 != hint_exists(&hint, HINT_PARAMETER), "Hint of parameter type should exist"); @@ -61,7 +59,6 @@ test1() { hint_free(hint); } - mxs_log_flush_sync(); ss_dfprintf(stderr, "\t..done\n"); return 0; diff --git a/server/core/test/test_log.cc b/server/core/test/test_log.cc index 420b0ccea..6bf8b3aa3 100644 --- a/server/core/test/test_log.cc +++ b/server/core/test/test_log.cc @@ -76,16 +76,10 @@ int main(int argc, char* argv[]) err = MXS_ERROR("%s", logstr); ss_dassert(err == 0); - err = mxs_log_flush(); - ss_dassert(err == 0); - logstr = "My name is %s %d years and %d months."; err = MXS_INFO(logstr, "TraceyTracey", 3, 7); ss_dassert(err == 0); - err = mxs_log_flush(); - ss_dassert(err == 0); - logstr = "My name is Tracey Tracey 47 years and 7 months."; err = MXS_INFO("%s", logstr); ss_dassert(err == 0); diff --git a/server/core/test/test_logorder.cc b/server/core/test/test_logorder.cc index cb8851170..110e613cf 100644 --- a/server/core/test/test_logorder.cc +++ b/server/core/test/test_logorder.cc @@ -113,7 +113,6 @@ int main(int argc, char** argv) nanosleep(&ts1, NULL); } - mxs_log_flush(); mxs_log_finish(); MXS_FREE(message); return 0; diff --git a/server/core/test/test_server.cc b/server/core/test/test_server.cc index ae6eabf3c..a06225c42 100644 --- a/server/core/test/test_server.cc +++ b/server/core/test/test_server.cc @@ -67,23 +67,19 @@ test1() ss_dfprintf(stderr, "testserver : creating server called MyServer"); server = server_alloc("uniquename", params.params()); ss_info_dassert(server, "Allocating the server should not fail"); - mxs_log_flush_sync(); char buf[120]; ss_dfprintf(stderr, "\t..done\nTest Parameter for Server."); ss_info_dassert(!server_get_parameter(server, "name", buf, sizeof(buf)), "Parameter should be null when not set"); server_add_parameter(server, "name", "value"); - mxs_log_flush_sync(); ss_dassert(server_get_parameter(server, "name", buf, sizeof(buf))); ss_info_dassert(strcmp("value", buf) == 0, "Parameter should be returned correctly"); ss_dfprintf(stderr, "\t..done\nTesting Unique Name for Server."); ss_info_dassert(NULL == server_find_by_unique_name("non-existent"), "Should not find non-existent unique name."); - mxs_log_flush_sync(); ss_info_dassert(server == server_find_by_unique_name("uniquename"), "Should find by unique name."); ss_dfprintf(stderr, "\t..done\nTesting Status Setting for Server."); status = server_status(server); - mxs_log_flush_sync(); ss_info_dassert(0 == strcmp("Running", status), "Status of Server should be Running by default."); if (NULL != status) { @@ -91,12 +87,10 @@ test1() } server_set_status_nolock(server, SERVER_MASTER); status = server_status(server); - mxs_log_flush_sync(); ss_info_dassert(0 == strcmp("Master, Running", status), "Should find correct status."); server_clear_status_nolock(server, SERVER_MASTER); MXS_FREE(status); status = server_status(server); - mxs_log_flush_sync(); ss_info_dassert(0 == strcmp("Running", status), "Status of Server should be Running after master status cleared."); if (NULL != status) @@ -106,7 +100,6 @@ test1() ss_dfprintf(stderr, "\t..done\nRun Prints for Server and all Servers."); printServer(server); printAllServers(); - mxs_log_flush_sync(); ss_dfprintf(stderr, "\t..done\nFreeing Server."); server_free((Server*)server); ss_dfprintf(stderr, "\t..done\n"); diff --git a/server/core/test/test_users.cc b/server/core/test/test_users.cc index 9f672a655..f15434c46 100644 --- a/server/core/test/test_users.cc +++ b/server/core/test/test_users.cc @@ -45,26 +45,20 @@ static int test1() ss_dfprintf(stderr, "testusers : Initialise the user table."); users = users_alloc(); - mxs_log_flush_sync(); ss_info_dassert(NULL != users, "Allocating user table should not return NULL."); ss_dfprintf(stderr, "\t..done\nAdd a user"); rv = users_add(users, "username", "authorisation", USER_ACCOUNT_ADMIN); - mxs_log_flush_sync(); ss_info_dassert(rv, "Should add one user"); rv = users_auth(users, "username", "authorisation"); - mxs_log_flush_sync(); ss_info_dassert(rv, "Fetch valid user must not return NULL"); rv = users_auth(users, "username", "newauth"); - mxs_log_flush_sync(); ss_info_dassert(rv == 0, "Fetch invalid user must return NULL"); ss_dfprintf(stderr, "\t..done\nAdd another user"); rv = users_add(users, "username2", "authorisation2", USER_ACCOUNT_ADMIN); - mxs_log_flush_sync(); ss_info_dassert(rv, "Should add one user"); ss_dfprintf(stderr, "\t..done\nDelete a user."); rv = users_delete(users, "username"); - mxs_log_flush_sync(); ss_info_dassert(rv, "Should delete just one user"); ss_dfprintf(stderr, "\t..done\nDump users table."); @@ -79,7 +73,6 @@ static int test1() ss_dfprintf(stderr, "\t..done\nFree user table."); users_free(users); - mxs_log_flush_sync(); ss_dfprintf(stderr, "\t..done\n"); return 0; diff --git a/server/modules/routing/binlogrouter/maxbinlogcheck.cc b/server/modules/routing/binlogrouter/maxbinlogcheck.cc index c9d0ff2d0..a7117ad1a 100644 --- a/server/modules/routing/binlogrouter/maxbinlogcheck.cc +++ b/server/modules/routing/binlogrouter/maxbinlogcheck.cc @@ -159,7 +159,6 @@ int main(int argc, char **argv) printf("ERROR: Failed to open binlog file %s: %s.\n", path, strerror(errno)); MXS_FREE(inst); - mxs_log_flush_sync(); mxs_log_finish(); exit(EXIT_FAILURE); } @@ -186,7 +185,6 @@ int main(int argc, char **argv) if (set_encryption_options(inst, key_file, aes_algo)) { MXS_FREE(inst); - mxs_log_flush_sync(); mxs_log_finish(); exit(EXIT_FAILURE); } @@ -203,21 +201,16 @@ int main(int argc, char **argv) blr_read_events_all_events(inst, &binlog_file, BLR_CHECK_ONLY); binlog_file.fix = true; - - mxs_log_flush_sync(); } /* Now read/check/fix the binary log */ int ret = blr_read_events_all_events(inst, &binlog_file, debug_out | report_header); - mxs_log_flush_sync(); - MXS_NOTICE("Check retcode: %i, Binlog Pos = %lu", ret, inst->binlog_position); close(inst->binlog_fd); MXS_FREE(inst); - mxs_log_flush_sync(); mxs_log_finish(); return ret; diff --git a/server/modules/routing/binlogrouter/test/testbinlog.cc b/server/modules/routing/binlogrouter/test/testbinlog.cc index e89610f29..3918dbb30 100644 --- a/server/modules/routing/binlogrouter/test/testbinlog.cc +++ b/server/modules/routing/binlogrouter/test/testbinlog.cc @@ -162,7 +162,6 @@ int main(int argc, char **argv) inst = static_cast(MXS_CALLOC(1, sizeof(ROUTER_INSTANCE))); if (inst == NULL) { - mxs_log_flush_sync(); mxs_log_finish(); return 1; @@ -884,7 +883,6 @@ int main(int argc, char **argv) return 1; } - mxs_log_flush_sync(); mxs_log_finish(); MXS_FREE(inst->user); MXS_FREE(inst->password);