Skip to content

Commit d4245e5

Browse files
authored
[Event Hubs] Partition Context fix (Azure#38265)
* fix * test fix
1 parent 5041d7c commit d4245e5

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/src/Listeners/EventHubListener.PartitionProcessor.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ private async Task MonitorCachedEvents(DateTimeOffset? lastCheckpointTime, Cance
282282
var details = GetOperationDetails(_mostRecentPartitionContext, "MaxWaitTimeElapsed");
283283
_logger.LogDebug($"Partition Processor has waited MaxWaitTime since last invocation and is attempting to invoke function on all held events ({details})");
284284

285+
UpdateCheckpointContext(triggerEvents, _mostRecentPartitionContext);
285286
await TriggerExecute(triggerEvents, _mostRecentPartitionContext, _functionExecutionToken).ConfigureAwait(false);
286287
if (!backgroundCancellationTokenSource.Token.IsCancellationRequested)
287288
{

sdk/eventhub/Microsoft.Azure.WebJobs.Extensions.EventHubs/tests/EventHubListenerTests.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@ public async Task ProcessEvents_MultipleDispatch_CheckpointsCorrectly(int batchC
112112
Times.Exactly(expected));
113113
}
114114

115-
[TestCase(1, 29)]
116-
[TestCase(5, 5)]
117-
[TestCase(10, 2)]
118-
[TestCase(30, 0)]
115+
[TestCase(1, 30)]
116+
[TestCase(5, 6)]
117+
[TestCase(10, 3)]
118+
[TestCase(30, 1)]
119119
[TestCase(35, 0)]
120120
public async Task ProcessEvents_MultipleDispatch_MinBatch_CheckpointsCorrectly_NoCheckpoint(int batchCheckpointFrequency, int expected)
121121
{
@@ -221,10 +221,10 @@ public async Task ProcessEvents_MultipleDispatch_MinBatch_CheckpointsCorrectly_R
221221
Times.AtLeastOnce);
222222
}
223223

224-
[TestCase(1, 29)]
225-
[TestCase(5, 5)]
226-
[TestCase(10, 2)]
227-
[TestCase(30, 0)]
224+
[TestCase(1, 30)]
225+
[TestCase(5, 6)]
226+
[TestCase(10, 3)]
227+
[TestCase(30, 1)]
228228
[TestCase(35, 0)]
229229
public async Task ProcessEvents_MultipleDispatch_MinBatch_CheckpointsCorrectly_OldCheckpoint(int batchCheckpointFrequency, int expected)
230230
{

0 commit comments

Comments
 (0)