- changed status to resolved
mlogger - ROOT - misleading error messages
The attached file diff is a proposed fix for the following two issues
- there is currently a double counting for ‘log_chn->statistics.events_written’ when writing ROOT files.
- there are misleading error messages when writing ROOT files due to unfiltered midas system events (BOR, EOR, ….)
Comments (11)
-
-
I am pretty sure the double-counting is still there. I do not remember fixing it. K.O.
-
Well, then teach me how to reproduce it.
-
reporter - attached Logger.odb
Our Logger settings
-
reporter In root_write()
at the end there you find
/* update statistics */
log_chn->statistics.events_written++;
log_chn->statistics.bytes_written += size;
log_chn->statistics.bytes_written_total += size;
root_write() is called in int wr_write(LOG_CHN* log_chn, const void* data, const int size).
There are many wr_write() over which I have no overview.
log_chn->statistics.events_written++ is called also in log_write():
INT log_write(LOG_CHN * log_chn, EVENT_HEADER * pevent) { INT status = 0, size; DWORD actual_time, start_time, duration; BOOL next_subrun; //printf("log_write %d\n", pevent->data_size + sizeof(EVENT_HEADER)); start_time = ss_millitime(); if (log_chn->writer) { int evt_size = pevent->data_size + sizeof(EVENT_HEADER); WriterInterface* wr = log_chn->writer; status = wr->wr_write(log_chn, pevent, evt_size); <-- here root_write() is called internally (at least I think) which increments events_written (see above) if (status == SUCCESS) { /* update statistics */ log_chn->statistics.events_written++; <-- here it is incremented again, hence double counting!! log_chn->statistics.bytes_written_uncompressed += evt_size; }
-
the double counting bug is issue 177. the bug double counted, too. K.O.
-
The wr->wr_write() function was written by KO in 2015:
So I assign this bug to him. Actually with the Looger.odb from above I was able to reproduce the error, so I can confirm that it’s still there:
/Stefan
-
- changed status to open
Problem still there.
-
-
assigned issue to
-
assigned issue to
-
confirmed. this is bug 177. K.O.
-
- changed status to resolved
dupe of issue 177. K.O.
- Log in to comment
Cannot reproduce the problem. Maybe you have to loggers running in parallel? Just did a quick check on a fresh experiment and got correct numbers (4493 events logged, 4441+50+2 events generated:![Screenshot 2020-03-27 at 15.38.18 .png](https://bitbucket.org/repo/z78jqA/images/448645761-Screenshot%202020-03-27%20at%2015.38.18%20.png)
I just outcommented the error message. Now the ROOT writer silently ignores the BOR/EOR events.