[PATCH] pg_test_fsync: close Windows alarm thread handles

Started by Harrison Boothabout 1 month ago3 messageshackers
Jump to latest
#1Harrison Booth
harrisontbooth@gmail.com

Attached is a follow-up to Sehrope's CF7218 timer fix - close each
created alarm-thread handle. Closing the handle leaves the callback
running.

This is a dependent supplement. Apply the included CreateThread
failure-check prerequisite, then this patch, on master 8e82d6610e7.
The prerequisite credits Sehrope; it contains only his timer fix.

Source-extracted probes on native ARM64 and emulated x64 show 200
retained handles before the change and none afterward, with all 200
callbacks completing. The actual pg_test_fsync -s 1 benchmark sequence
also passes on both targets in the combined integration builds.
Formatting and independent reviews pass.

The measurements establish handle cleanup and callback completion;
they aren't performance benchmarks.

Let me know your thoughts.

Best,

Harrison

Attachments:

LOCAL-PREREQUISITE-CF7218-timer-failure-check.patchtext/x-diff; charset=US-ASCII; name=LOCAL-PREREQUISITE-CF7218-timer-failure-check.patchDownload+1-3
0001-Close-the-Windows-pg_test_fsync-timer-thread-handle.patchtext/x-diff; charset=US-ASCII; name=0001-Close-the-Windows-pg_test_fsync-timer-thread-handle.patchDownload+5-2
#2Alvaro Herrera
alvherre@kurilemu.de
In reply to: Harrison Booth (#1)
Re: [PATCH] pg_test_fsync: close Windows alarm thread handles

On 2026-Oct-13, harrisontbooth@gmail.com wrote:

Attached is a follow-up to Sehrope's CF7218 timer fix - close each
created alarm-thread handle. Closing the handle leaves the callback
running.

This is a dependent supplement. Apply the included CreateThread
failure-check prerequisite, then this patch, on master 8e82d6610e7.
The prerequisite credits Sehrope; it contains only his timer fix.

Please don't start new threads just to propose a fix-up to some other
proposed patch. Reply with your patch to the original thread instead.

Thanks

--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
"Investigación es lo que hago cuando no sé lo que estoy haciendo"
(Wernher von Braun)

#3Heikki Linnakangas
hlinnaka@iki.fi
In reply to: Alvaro Herrera (#2)
Re: [PATCH] pg_test_fsync: close Windows alarm thread handles

On 13/10/2026 19:05, Álvaro Herrera wrote:

On 2026-Oct-13, harrisontbooth@gmail.com wrote:

Attached is a follow-up to Sehrope's CF7218 timer fix - close each
created alarm-thread handle. Closing the handle leaves the callback
running.

This is a dependent supplement. Apply the included CreateThread
failure-check prerequisite, then this patch, on master 8e82d6610e7.
The prerequisite credits Sehrope; it contains only his timer fix.

Please don't start new threads just to propose a fix-up to some other
proposed patch. Reply with your patch to the original thread instead.

This is actually a different bug, it just happens to touch the same
piece of code. Harrison, You did start a separate thread for a machine
review of the other patch though, so yeah, please don't do that.

Committed this one, thanks.

- Heikki