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:
vraatikka
2013-07-26 23:06:12 +03:00
parent 3989615197
commit b566c41067
2 changed files with 58 additions and 42 deletions

View File

@ -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);