git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 414e755) | patch
Use ResourceOwner to track WaitEventSets.
2023年11月23日 11:31:36 +0000 (13:31 +0200)
2023年11月23日 11:31:36 +0000 (13:31 +0200)
commit 50c67c2019ab9ade8aa8768bfe604cd802fe8591
Use ResourceOwner to track WaitEventSets.

A WaitEventSet holds file descriptors or event handles (on Windows).
If FreeWaitEventSet is not called, those fds or handles are leaked.
Use ResourceOwners to track WaitEventSets, to clean those up
automatically on error.

This was a live bug in async Append nodes, if a FDW's
ForeignAsyncRequest function failed. (In back branches, I will apply a
more localized fix for that based on PG_TRY-PG_FINALLY.)

The added test doesn't check for leaking resources, so it passed even
before this commit. But at least it covers the code path.

In the passing, fix misleading comment on what the 'nevents' argument
to WaitEventSetWait means.

Report by Alexander Lakhin, analysis and suggestion for the fix by
Tom Lane. Fixes bug #17828.

Reviewed-by: Alexander Lakhin, Thomas Munro
Discussion: https://www.postgresql.org/message-id/472235.1678387869@sss.pgh.pa.us
contrib/postgres_fdw/expected/postgres_fdw.out diff | blob | blame | history
contrib/postgres_fdw/sql/postgres_fdw.sql diff | blob | blame | history
src/backend/executor/nodeAppend.c diff | blob | blame | history
src/backend/libpq/pqcomm.c diff | blob | blame | history
src/backend/postmaster/postmaster.c diff | blob | blame | history
src/backend/postmaster/syslogger.c diff | blob | blame | history
src/backend/storage/ipc/latch.c diff | blob | blame | history
src/include/storage/latch.h diff | blob | blame | history
src/include/utils/resowner.h diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /