Skip to content

Fix missing offsetString in EventContext checkpoint update#48637

Draft
j7nw4r wants to merge 1 commit intomainfrom
fix/eventhubs-checkpoint-offset-46752
Draft

Fix missing offsetString in EventContext checkpoint update#48637
j7nw4r wants to merge 1 commit intomainfrom
fix/eventhubs-checkpoint-offset-46752

Conversation

@j7nw4r
Copy link
Copy Markdown
Member

@j7nw4r j7nw4r commented Mar 30, 2026

Description

EventContext.updateCheckpointAsync() only called setOffset(Long) (deprecated), but BlobCheckpointStore.updateCheckpoint() reads getOffsetString() which returned null — causing the offset to never be stored in checkpoint blob metadata.

Added setOffsetString(eventData.getOffsetString()) to match the pattern already used in EventBatchContext.

Root Cause

  • EventContext created a Checkpoint with only .setOffset(eventData.getOffset()) (deprecated Long setter)
  • BlobCheckpointStore.updateCheckpoint() reads checkpoint.getOffsetString() to write metadata
  • Checkpoint.getOffsetString() has no fallback to the Long offset field, so it returned null
  • Result: offset was silently dropped from blob metadata, breaking partition switching and monitoring

Fix

One-line addition of .setOffsetString(eventData.getOffsetString()) in EventContext.updateCheckpointAsync(), consistent with EventBatchContext which already calls both setters.

Fixes #46752

Added EventContextTest.updateCheckpointAsyncSetsOffsetString() which verifies
that offsetString is populated on the Checkpoint passed to the store. This test
fails without the fix (offsetString is null) and passes with it.

Fix: added setOffsetString(eventData.getOffsetString()) in
EventContext.updateCheckpointAsync(), matching the pattern already used in
EventBatchContext.

Fixes #46752

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@j7nw4r j7nw4r force-pushed the fix/eventhubs-checkpoint-offset-46752 branch from a68fa9c to 1abecdb Compare March 30, 2026 20:06
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.

[BUG] [CRITICAL] Missing offset in checkpoint store

1 participant