Skip to content

Conversation

@TheSafo
Copy link
Contributor

@TheSafo TheSafo commented Jan 6, 2026

What does this PR do?

Adds flush_every_n_blocks to traditional and logrotate generators. This is designed to be used in conjunction with block-based throttling to ensure that blocks are still flushed regularly.

Motivation

BufWriter generally only writes out to disk once its capacity is full (or on log rotate). For standard usage of lading, this works fine since the capacity is set at the maximum throttler capacity (in bytes), which lading trires its best to run at, so it flushes ~every second. However, for block-based throttling (and varying block sizes) it's less likely that 1 second of blocks fills the maximum possible bytes capacity for those blocks (blocks per second times max block size), so having a config option to manually flush every few blocks ensures regular flush intervals.

Related issues

Follow up of #1675

Copy link
Contributor Author

TheSafo commented Jan 6, 2026

@TheSafo TheSafo force-pushed the jsaf/flush-every-n branch from a2c8d36 to 0e90fb1 Compare January 6, 2026 18:50
@TheSafo TheSafo changed the base branch from jsaf/block-based-limiter to graphite-base/1683 January 6, 2026 21:00
@TheSafo TheSafo force-pushed the jsaf/flush-every-n branch from 0e90fb1 to b69f29c Compare January 6, 2026 21:24
@TheSafo TheSafo force-pushed the graphite-base/1683 branch from 9ae8ce6 to 648642c Compare January 6, 2026 21:24
@TheSafo TheSafo changed the base branch from graphite-base/1683 to jsaf/block-based-limiter January 6, 2026 21:24
@TheSafo TheSafo force-pushed the jsaf/block-based-limiter branch from 648642c to a636e4c Compare January 6, 2026 21:46
@TheSafo TheSafo force-pushed the jsaf/flush-every-n branch from b69f29c to 403c48a Compare January 6, 2026 21:46
@TheSafo TheSafo force-pushed the jsaf/flush-every-n branch from 403c48a to e13d903 Compare January 6, 2026 21:58
@TheSafo TheSafo force-pushed the jsaf/block-based-limiter branch from a636e4c to 661d654 Compare January 6, 2026 21:58
@TheSafo TheSafo force-pushed the jsaf/flush-every-n branch from e13d903 to a62c9fd Compare January 6, 2026 22:13
@TheSafo TheSafo force-pushed the jsaf/block-based-limiter branch 2 times, most recently from 867b097 to e1d8abc Compare January 6, 2026 22:29
@TheSafo TheSafo force-pushed the jsaf/flush-every-n branch from a62c9fd to 8180361 Compare January 6, 2026 22:29
@TheSafo TheSafo force-pushed the jsaf/block-based-limiter branch from e1d8abc to e73bb21 Compare January 6, 2026 22:31
@TheSafo TheSafo force-pushed the jsaf/flush-every-n branch from 8180361 to 899bfeb Compare January 6, 2026 22:31
@TheSafo TheSafo force-pushed the jsaf/flush-every-n branch 2 times, most recently from 886980b to 8071239 Compare January 7, 2026 14:34
@TheSafo TheSafo changed the title flush every Add flush_every_n_blocks config option to BufWriter generators Jan 7, 2026
@TheSafo TheSafo mentioned this pull request Jan 7, 2026
@TheSafo TheSafo force-pushed the jsaf/block-based-limiter branch from e73bb21 to 57bce08 Compare January 15, 2026 21:34
@TheSafo TheSafo force-pushed the jsaf/flush-every-n branch from 8071239 to ff8a57f Compare January 15, 2026 21:34
@TheSafo TheSafo force-pushed the jsaf/block-based-limiter branch from 57bce08 to a47d241 Compare January 15, 2026 21:35
@TheSafo TheSafo force-pushed the jsaf/flush-every-n branch from ff8a57f to 1be6e74 Compare January 15, 2026 21:35
@TheSafo TheSafo marked this pull request as ready for review January 16, 2026 18:13
@TheSafo TheSafo requested a review from a team as a code owner January 16, 2026 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants