Re: Postmaster crashes on SIGHUP when oauth_validator_libraries holds only whitespace - Mailing list pgsql-bugs

From Grigorev Jurij
Subject Re: Postmaster crashes on SIGHUP when oauth_validator_libraries holds only whitespace
Date
Msg-id 0bc0874d0b774514a61d8d7b30825e0f@localhost.localdomain
Whole thread
In response to Re: Postmaster crashes on SIGHUP when oauth_validator_libraries holds only whitespace  (Daniel Gustafsson <daniel@yesql.se>)
List pgsql-bugs
Hi Daniel,

You're right.  I would rather not treat NULL as an empty setting, since
that would turn an internal programming error into the user-facing
"must be set" error.  Attached v3 adds:

    Assert(oauth_validator_libraries_string != NULL);

before the pstrdup().

I also moved the whitespace-only TAP case to after the
pg_hba_file_rules() check.  Its previous position made the test racy:
wait_for_log() synchronized with the postmaster reload, but not
necessarily with the process-local GUC state of the existing bgconn.
As a result, pg_hba_file_rules() could run in a backend that still had
the whitespace value loaded and return unexpected empty fields.

Moving the case after that assertion avoids making the
pg_hba_file_rules() result depend on the timing of SIGHUP processing in
bgconn.  After restoring the setting, the test runs SHOW
oauth_validator_libraries through bgconn, ensuring that the backend has
processed the second SIGHUP before the later tests continue.

Thanks,
  Yuriy
Attachment

pgsql-bugs by date:

Previous
From: Manuel Reyes Bravo
Date:
Subject: Re: Detaching a child table makes an expression using it unrestorable
Next
From: Alexander Korotkov
Date:
Subject: Re: BUG #19633: Unexpected results of IN (subquery) with a non-deterministic collation