mirror of
https://github.com/KumoCorp/kumomta.git
synced 2026-09-21 08:01:11 +00:00
When hooks were developed, they were essentially "forked" from the log file implementation and the back_pressure setting and semantics were carried over from there. Those semantics were to put an upper bound on the number of log records that could be submitted to the logger, causing the submitter to block until the logger could catch up and reducing system pressure overall by slowing things down. With log hooks we're spawning a parallel task in the tail end which meant that the back pressure was only partially effective: it didn't apply to the end-to-end processing of a log hook. This commit addresses that issue by introducing a semaphore that permits up to the configured back_pressure number of concurrent log hook tasks to be running at once, slowing things down when that limit is reached.