Changeset: 1da8f96004c5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/1da8f96004c5
Modified Files:
        gdk/gdk_logger.c
Branch: Jun2023
Log Message:

Backed out changeset 9faee3ae69c1


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 (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) {
+               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

Reply via email to