Hi,
I think we hit this bug and I think I figured out why it was
happening tonight but I am yet to test my theory. I think
the problem is when the alarm() goes off, SIGALRM is received and the alarm
handler is called while lck = 1. The alarm handler calls write_log
if(now >= next_write_log)
{
write_log(0);
next_write_log = now + cfg -> flush;
}
alarm(1);
}
which cannot do much because lck still equals 1 ie fails this check:
process.c: 616: else if((writing == 0) && (lck == 0) && (may_write == 1)) /*
delay if another write cycle is still in progress */
and ends up:
process.c: 722 else
process.c: 723 {
process.c: 724 DEBUG(DBG_STATE, sprintf(dbg, "flushing delayed (writing
== %d, lck == %d, may_write == %d)\n",writing,lck,may_write));
process.c: 725 }
The thing is, because lck is 1, it can never reach the bit of the code where
lck is set to 0 and so nothing
is written to the net-acct.log file until you restart nacctd.
This is just a theory at the moment. I intend on trying the patch in this bug
and my own patch
over the next week and can provide feedback to this bug. Additionally, if
people can provide
feedback about my analysis, feel free to email me.
Best regards,
Ben Marsh