Refactoring DetermineSleepTime()

Started by Thomas Munro8 months ago1 messageshackers

Thread notes

1 note#refactor
hackorum-bot#refactor
hackorum-bot
1 day ago

@global #refactor

#refactor
Jump to latest
#1Thomas Munro
thomas.munro@gmail.com

Hi,

DetermineSleepTime() came with background workers (commit da07a1e8).
While working on I/O workers, which now also have time-scheduled
postmaster duties to support io_worker_launch_interval, I wondered if
it might be time to refactor it and make such things follow a standard
pattern, including the much more ancient SIGKILL and the
lockfile/socket stuff. Sketch patch attached.

Something similar happened to walreceiver.c.

Attachments:

t139250_1
0001-Refactor-the-postmaster-s-periodic-job-scheduling.patchtext/x-patch; charset=US-ASCII; name=0001-Refactor-the-postmaster-s-periodic-job-scheduling.patchDownload+124-124