Re: Remove extra Logging_collector check before calling SysLogger_Start()

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Remove extra Logging_collector check before calling SysLogger_Start()
Date: 2021-12-03 08:13:14
Message-ID: 8CD21DAD-10C2-46F1-9D6F-4391C527475F@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 3 Dec 2021, at 08:58, Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:

> It seems like there's an extra Logging_collector check before calling
> SysLogger_Start(). Note that the SysLogger_Start() has a check to
> return 0 if Logging_collector is off. This change is consistent with
> the other usage of SysLogger_Start().
>
> /* If we have lost the log collector, try to start a new one */
> - if (SysLoggerPID == 0 && Logging_collector)
> + if (SysLoggerPID == 0)
> SysLoggerPID = SysLogger_Start();

I think the code reads clearer with the Logging_collector check left intact,
and avoiding a function call in this codepath doesn't hurt.

--
Daniel Gustafsson https://vmware.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bharath Rupireddy 2021-12-03 08:32:27 Re: Remove extra Logging_collector check before calling SysLogger_Start()
Previous Message Bharath Rupireddy 2021-12-03 07:58:25 Remove extra Logging_collector check before calling SysLogger_Start()