Changeset: f0f780110902 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/f0f780110902 Branch: default Log Message:
Merge with Jun2023 branch. diffs (37 lines): diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c --- a/gdk/gdk_logger.c +++ b/gdk/gdk_logger.c @@ -2421,10 +2421,15 @@ log_cleanup_range(logger *lg, ulng id) static void do_rotate(logger *lg) { - logged_range *next = lg->current->next; + logged_range *cur = lg->current; + logged_range *next = cur->next; if (next) { assert(ATOMIC_GET(&next->refcount) == 1); - lg->current = lg->current->next; + lg->current = next; + if (!LOG_DISABLED(lg) && ATOMIC_GET(&cur->refcount) == 1) { + close_stream(cur->output_log); + cur->output_log = NULL; + } } } @@ -3099,7 +3104,14 @@ log_tflush(logger *lg, ulng file_id, uln } /* else somebody else has flushed our log file */ - ATOMIC_DEC(&frange->refcount); + if (ATOMIC_DEC(&frange->refcount) == 1 && !LOG_DISABLED(lg)) { + rotation_lock(lg); + if (frange != lg->current) { + close_stream(frange->output_log); + frange->output_log = NULL; + } + rotation_unlock(lg); + } if (ATOMIC_DEC(&lg->nr_flushers) == 0) { /* I am the last flusher _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org