[syslog-ng] [PATCH 3/7] fix db stored/dropped messages counter handling
Gergely Nagy
algernon at balabit.hu
Sat May 28 14:35:44 CEST 2011
Balazs Scheidler <bazsi at balabit.hu> writes:
> On Mon, 2011-05-23 at 11:56 +0200, Gergely Nagy wrote:
>> From: NagyAttila <naat at balabit.hu>
>>
>> Do not decrease the stored counter in log_queue_fifo_pop_head(), and
>> initialize the counters properly in afsql_dd_init(): the
>> stored/dropped counters were swapped.
>>
>> Signed-off-by: Attila Nagy <naat at balabit.hu>
>> ---
>> lib/logqueue-fifo.c | 3 ---
>> modules/afsql/afsql.c | 2 +-
>> 2 files changed, 1 insertions(+), 4 deletions(-)
>>
>> diff --git a/lib/logqueue-fifo.c b/lib/logqueue-fifo.c
>> index 1a34776..f78f00c 100644
>> --- a/lib/logqueue-fifo.c
>> +++ b/lib/logqueue-fifo.c
>> @@ -326,9 +326,6 @@ log_queue_fifo_pop_head(LogQueue *s, LogMessage **msg, LogPathOptions *path_opti
>> */
>> return FALSE;
>> }
>> - g_static_mutex_lock(&self->super.lock);
>> - stats_counter_dec(self->super.stored_messages);
>> - g_static_mutex_unlock(&self->super.lock);
>>
>> if (push_to_backlog)
>> {
>
> I'm somewhat puzzled here. The queue manages the "stored" counter
> itself, the increments remained there in all paths (e.g. push_tail,
> rewind, etc). What is going to perform the decrease operation then?
Looks like I either missed a patch when preparing these, or I horribly
misunderstood the team's intent. I'll look into it, and see if I can
figure out what's this hunk is about.
--
|8]
More information about the syslog-ng
mailing list