Log manager sometimes failed to flush after skygw_log_write_flush because log client signaled filw writer thread too early. Fixed so that write is done first and file writer is registered after that. Except in cases where skygw_log_flush was called. Then only flush is triggered.
Added a few trivial cases to test.
This commit is contained in:
@ -67,11 +67,14 @@ int main(int argc, char* argv[])
|
||||
skygw_logmanager_init(NULL, argc, argv);
|
||||
logstr = ("First write with flush.");
|
||||
err = skygw_log_write_flush(NULL, LOGFILE_ERROR, logstr);
|
||||
|
||||
logstr = ("Second write, no flush.");
|
||||
|
||||
logstr = ("Second write with flush.");
|
||||
err = skygw_log_write_flush(NULL, LOGFILE_ERROR, logstr);
|
||||
|
||||
logstr = ("Third write, no flush.");
|
||||
err = skygw_log_write(NULL, LOGFILE_ERROR, logstr);
|
||||
|
||||
logstr = ("Third write, no flush. Next flush only.");
|
||||
logstr = ("Fourth write, no flush. Next flush only.");
|
||||
err = skygw_log_write(NULL, LOGFILE_ERROR, logstr);
|
||||
|
||||
err = skygw_log_flush(LOGFILE_ERROR);
|
||||
|
Reference in New Issue
Block a user