Skip to content

Commit b772af8

Browse files
authored
Fixing EventProcessor.Checkpoint span duration (Azure#48672)
* Added an await so the OTel span matches function duration + catch is also checked. * Updating changelog
1 parent d998a1e commit b772af8

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

sdk/eventhub/Azure.Messaging.EventHubs.Processor/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
### Bugs Fixed
1010

11+
- UpdateCheckpointAsync in the 'EventProcessorClient` was not awaiting the Checkpoint Stores 'UpdateCheckpointAsync' method.
12+
By not awaiting we were starting the OTel span and closing it almost immediately. The catch would've been ignored as well.
13+
1114
### Other Changes
1215

1316
## 5.12.0-beta.2 (2025-02-11)

sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/EventProcessorClient.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,7 @@ protected override Task UpdateCheckpointAsync(string partitionId,
963963
/// <param name="startingPosition">The starting position to associate with the checkpoint, indicating that a processor should begin reading from the next event in the stream.</param>
964964
/// <param name="cancellationToken">A <see cref="CancellationToken" /> instance to signal a request to cancel the operation.</param>
965965
///
966-
protected override Task UpdateCheckpointAsync(string partitionId,
966+
protected override async Task UpdateCheckpointAsync(string partitionId,
967967
CheckpointPosition startingPosition,
968968
CancellationToken cancellationToken)
969969
{
@@ -989,7 +989,7 @@ protected override Task UpdateCheckpointAsync(string partitionId,
989989

990990
try
991991
{
992-
return CheckpointStore.UpdateCheckpointAsync(FullyQualifiedNamespace, EventHubName, ConsumerGroup, partitionId, Identifier, startingPosition, cancellationToken);
992+
await CheckpointStore.UpdateCheckpointAsync(FullyQualifiedNamespace, EventHubName, ConsumerGroup, partitionId, Identifier, startingPosition, cancellationToken).ConfigureAwait(false);
993993
}
994994
catch (Exception ex)
995995
{

0 commit comments

Comments
 (0)