Re: waiteventset.c XXX

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Subject: Re: waiteventset.c XXX
Date: 2025-09-22 15:23:33
Message-ID: 202509221320.2phanrtodhzb@alvherre.pgsql
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2025-Sep-18, Robert Haas wrote:

> I submit that we should not have both a comment that says we must save
> and restore errno and code that doesn't. Maybe the comment is intended
> to imply that the caller should be doing such a save and restore, but
> if so, then (a) that's not very clear from the wording and (b) why the
> XXX?

I understand the comment as saying that the caller should do
save/restore of errno. However, looking at several places that are
calling SetLatch() (which is the only caller of this function) it
appears that at least several of them have actually forgotten to do so
(didn't scan all of them but checked a couple and they weren't doing
it). I think what you have found is not just a bogus comment, but an
actual bug or class of bugs.

I think your contact list has an outdated address for Heikki, or at
least one he hasn't used in a very long time.

--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
"Cuando mañana llegue pelearemos segun lo que mañana exija" (Mowgli)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2025-09-22 15:26:28 Re: Use WALReadFromBuffers in more places
Previous Message Tom Lane 2025-09-22 14:54:07 Re: Having postgresql.org link to cgit instead of gitweb