Skip to content

Conversation

@iambriccardo
Copy link
Contributor

@iambriccardo iambriccardo commented Nov 28, 2025

This PR refines the TimeoutStream behavior to correctly exhibit the intended timeout semantics. Previously, the timer only started when the inner stream returned Pending. Now the timer starts immediately when reset, giving us a fixed window per batch.
The semantics are:

  • Timer starts as soon as a new batch begins.
  • If the batch isn't filled within max_batch_fill_duration and the stream goes idle, we emit a timeout.
  • If data is actively flowing, we prioritize delivery over the timeout, even if the timer has technically expired, we keep returning values as long as they're available.

This prevents the timeout from interrupting a healthy stream that happens to be slow, while still guaranteeing we flush partial batches when the source truly goes quiet.

@coveralls
Copy link

coveralls commented Nov 28, 2025

Pull Request Test Coverage Report for Build 19759445592

Details

  • 12 of 12 (100.0%) changed or added relevant lines in 1 file are covered.
  • 24 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.02%) to 82.338%

Files with Coverage Reduction New Missed Lines %
etl-postgres/src/tokio/test_utils.rs 4 86.47%
etl/src/replication/client.rs 20 85.55%
Totals Coverage Status
Change from base Build 19701980580: -0.02%
Covered Lines: 16428
Relevant Lines: 19952

💛 - Coveralls

@iambriccardo iambriccardo marked this pull request as ready for review November 28, 2025 09:43
@iambriccardo iambriccardo requested a review from a team as a code owner November 28, 2025 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants