Skip to content

Release/0.19.0#152

Merged
Oguzhan Unlu (oguzhanunlu) merged 5 commits intomainfrom
release/0.19.0
Jan 8, 2026
Merged

Release/0.19.0#152
Oguzhan Unlu (oguzhanunlu) merged 5 commits intomainfrom
release/0.19.0

Conversation

@oguzhanunlu
Copy link
Collaborator

No description provided.

Increase the default SDK retry count from 3 to 10 for Kinesis, DynamoDB and CloudWatch clients used by KCL.
When a consumer group rebalances, the Kafka consumer must commit offsets
before partitions are revoked.

Previously we were using "Eager" rebalance revoke mode from fs2-kafka,
with the following consequences:

1. Partitions were revoked immediately without waiting for the
   application to commit offsets. This could lead to duplicates.
2. The commit occasionally failed with a RebalanceInProgressException,
   if the application tried to commit offsets after the rebalance had
   started.

This change switches to "Graceful" rebalance revoke mode. It works as
follows:

1. Source waits up to session.timeout.ms for the fs2 stream to
   finalize. This includes committing outstanding offsets.
2. Rebalancing only proceeds after the fs2 stream has finalized, or
   after session.timeout.ms. This reduces the possibility of duplicates
   due to re-processing.
3. We catch and ignore the RebalanceInProgressException in case the
   downstream application cannot finalize the fs2 stream within the
   session timeout. This is needed e.g. for Lake Loader which is slow
   to finalize a window.
Common streams is built around the concept of a stream of streams:
`Stream[F, Stream[F, A]]`. The nesting of `Stream` is needed so the
Source has a way to force the app to immediately checkpoint. This is
needed e.g. at the end of a kinesis shard, or when kafka rebalances.

We already allowed eager processing of inner streams under some
circumstances, i.e. the app can start processing the next inner stream
while the preceding inner stream is still finalizing. But we did not
have eager processing under all circumstances.

This PR allows the eager processing feature to work in more scenarios.
It will have most impact on the kinesis source near a shard end, and in
particular an app that works with timed windows, e.g. Lake Loader.
@oguzhanunlu Oguzhan Unlu (oguzhanunlu) merged commit 71748db into main Jan 8, 2026
1 check passed
@oguzhanunlu Oguzhan Unlu (oguzhanunlu) deleted the release/0.19.0 branch January 8, 2026 14:52
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.

2 participants