Thread: Typo in comment for pgstat_database_flush_cb()

Typo in comment for pgstat_database_flush_cb()

From
Etsuro Fujita
Date:
Another thing I noticed is $SUBJECT: I think “if lock could not
immediately acquired” should be “if lock could not be immediately
acquired”.  Attached is a patch for that.

Best regards,
Etsuro Fujita

Attachment

Re: Typo in comment for pgstat_database_flush_cb()

From
Tender Wang
Date:


Etsuro Fujita <etsuro.fujita@gmail.com> 于2025年3月30日周日 18:28写道:
Another thing I noticed is $SUBJECT: I think “if lock could not
immediately acquired” should be “if lock could not be immediately
acquired”.  Attached is a patch for that.

Agree.
The patch looks good to me.


--
Thanks,
Tender Wang

Re: Typo in comment for pgstat_database_flush_cb()

From
Heikki Linnakangas
Date:
On 30/03/2025 13:28, Etsuro Fujita wrote:
> Another thing I noticed is $SUBJECT: I think “if lock could not
> immediately acquired” should be “if lock could not be immediately
> acquired”.  Attached is a patch for that.

Yep. And there are more instances of the same typo in other such 
flush_cb functions, if you search for "immediately acquired".

-- 
Heikki Linnakangas
Neon (https://neon.tech)



Re: Typo in comment for pgstat_database_flush_cb()

From
Heikki Linnakangas
Date:
On 30/03/2025 14:32, Heikki Linnakangas wrote:
> On 30/03/2025 13:28, Etsuro Fujita wrote:
>> Another thing I noticed is $SUBJECT: I think “if lock could not
>> immediately acquired” should be “if lock could not be immediately
>> acquired”.  Attached is a patch for that.
> 
> Yep. And there are more instances of the same typo in other such 
> flush_cb functions, if you search for "immediately acquired".

While we're at it, the comment feels a bit awkward to me anyway. Maybe 
rephrase it to "If nowait is true and the lock could not be immediately 
acquired, returns false without flushing the entry. Otherwise returns true."

-- 
Heikki Linnakangas
Neon (https://neon.tech)



Re: Typo in comment for pgstat_database_flush_cb()

From
"Gurjeet Singh"
Date:
On Sun Mar 30, 2025 at 4:39 AM PDT, Heikki Linnakangas wrote:
> On 30/03/2025 14:32, Heikki Linnakangas wrote:
>> On 30/03/2025 13:28, Etsuro Fujita wrote:
>>> Another thing I noticed is $SUBJECT: I think “if lock could not
>>> immediately acquired” should be “if lock could not be immediately
>>> acquired”.  Attached is a patch for that.
>>
>> Yep. And there are more instances of the same typo in other such
>> flush_cb functions, if you search for "immediately acquired".

+1 for chainging other occurrences of this in other pgstat_*.c files.

> While we're at it, the comment feels a bit awkward to me anyway. Maybe
> rephrase it to "If nowait is true and the lock could not be immediately
> acquired, returns false without flushing the entry. Otherwise returns true."

This rephrasing does sounds better.

Best regards,
Gurjeet
http://Gurje.et