Repository navigation
Skip non-lease entity types in DynamoDBMultiStreamLeaseSerializer - #1792
Merged
lucienlu-aws merged 1 commit intoJul 15, 2026
Merged
lucienlu-aws merged 1 commit into
lucienlu-aws merged 1 commit into
Conversation
DynamoDBLeaseSerializer#fromDynamoRecord returns null for records whose
entityType is not LEASE (with the single table format, worker metrics
and coordinator state are stored in the lease table). The multi-stream
serializer dereferenced the result unconditionally, throwing
NullPointerException ('Failed to deserialize lease') on every lease
table scan for any MultiStreamTracker application with single table
format active - the default for applications with a fresh lease table.
Return null instead, matching the base serializer's contract, and add
serializer tests mirroring DynamoDBLeaseSerializerTest.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
mrhammeda
temporarily deployed
to
manual-approval
July 13, 2026 22:58 — with
GitHub Actions
Inactive
zhenpewu
approved these changes
Jul 13, 2026
lucienlu-aws
approved these changes
Jul 15, 2026
zchrss-aws
added a commit
to zchrss-aws/amazon-kinesis-client
that referenced
this pull request
Jul 16, 2026
zchrss-aws
added a commit
that referenced
this pull request
Jul 21, 2026
* Prepare for KCL release v3.5.1 * Add version range for jackson-databind bump * Add logback 1.3.16 bump to CHANGELOG * Add #1792 to changelog
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available: Fixes #1791
Description of changes:
DynamoDBLeaseSerializer#fromDynamoRecord(record, leaseToUpdate)returnsnullfor records whoseentityTypeis notLEASE(with the single table format, worker metrics and coordinator state are stored in the lease table).DynamoDBMultiStreamLeaseSerializer#fromDynamoRecorddereferenced the result unconditionally, so anyMultiStreamTrackerapplication with single table format active β the default for applications with a fresh lease table β throwsNullPointerException(ERROR Failed to deserialize lease) for every non-lease item on every lease table scan, from bothScheduler.shouldInitiateLeaseSyncat startup andPeriodicShardSyncManager.runShardSyncthereafter.This change returns
nullfor non-lease records, matching the base serializer's contract (DynamoDBLeaseRefresher.list()already skipsnullresults), and adds serializer tests mirroringDynamoDBLeaseSerializerTest: the four non-lease entity types returnnullinstead of throwing, whileLEASEand legacy no-entityTyperecords still deserialize with the multi-stream fields intact (plus a round-trip test).Verified with the reproducer from #1791: on a fresh application with a one-stream
MultiStreamTrackeragainst DynamoDB Local + kinesis-mock, 3.5.0 logs one NPE per non-lease item per scan (16 in a 180s run); with this change, zero errors with the same mixed lease-table contents (LEADER,CLIENT_VERSION_MIGRATION,WORKER_METRIC_STATS,LEASE). The new tests fail with the production stack trace before the fix and pass after;DynamoDBLeaseSerializerTeststill passes (22 tests total).By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
π€ Generated with Claude Code