Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: postgresql-cfbot/postgresql
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: cf/5266~1
Choose a base ref
...
head repository: postgresql-cfbot/postgresql
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: cf/5266
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Mar 6, 2025

  1. Fix race condition in TAP test 007_pre_auth

    The authentication test added in c76db55 expects a backend to start
    and wait at the injection point "init-pre-auth".  A query is used to
    retrieve the PID of the backend waiting at authentication, but its WHERE
    clause was too soft, checking only for a backend in a "starting" state.
    
    As proved by the CI, this WHERE clause is not enough.  There is a small
    window between the moment when the backend is reported as "starting" in
    its backend entry and the moment when it waits in its injection point,
    and it was possible for the test to return the PID of a backend process
    not yet waiting in the injection point, causing spurious failures.  This
    issue is fixed by tweaking the query retrieving the PID of the backend
    waiting before authentication so as we check for "init-pre-auth" in its
    wait_event.  An extra check based on the backend_type is added, based on
    a suggestion by Jacob, to be more cautious.
    
    Error spotted by the CI on Windows, but it could happen anywhere, as
    long as the authentication path is slow enough compared to the TAP test.
    
    Reported-by: Andres Freund <[email protected]>
    Author: Jacob Champion <[email protected]>
    Co-authored-by: Michael Paquier <[email protected]>
    Discussion: https://postgr.es/m/soexrl7oeyku24bj3czupxmv27ow35u6edymp5y3oyoysbe2kb@r3tgoos2xp2x
    michaelpq committed Mar 6, 2025
    Configuration menu
    Copy the full SHA
    e208026 View commit details
    Browse the repository at this point in the history
Loading