Azure 事件中心 - IEventProcessor 的 CloseAsync 中的 LeaseLostException

标签 azure azure-eventhub

我们对CloseAsync(PartitionContext, CloseReason)有以下实现我们的 IEventProcessor 中的方法:

public async Task CloseAsync(PartitionContext context, CloseReason reason)
{
    // log reason and partition id

    if (reason == CloseReason.Shutdown)
    {
        // log shutdown event
        await context.CheckpointAsync();
    }
}

我们知道 LeaseLost 异常在此方法中很好,并且我们看到了这些线程:

Azure EventHub & Function LeaseLostException

What is causing Azure Event Hubs ReceiverDisconnectedException/LeaseLostException?

当处理器关闭时,它曾经在某些调用中失败,但在其他调用中成功。 最近,我们注意到对 CloseAsync() 的所有调用始终失败。当原因是CloseReason.Shutdown时并且总是出现完全相同的异常 LeaseLostException 。这是完整的异常消息和堆栈跟踪:

Message: 'The lease ID specified did not match the lease ID for the blob.'

StackTrace:

at Microsoft.Azure.EventHubs.Processor.AzureStorageCheckpointLeaseManager.UpdateLeaseCoreAsync(AzureBlobLease lease) at Microsoft.Azure.EventHubs.Processor.AzureStorageCheckpointLeaseManager.UpdateCheckpointAsync(Lease lease, Checkpoint checkpoint) at Microsoft.Azure.EventHubs.Processor.PartitionContext.PersistCheckpointAsync(Checkpoint checkpoint) at CloseAsync(PartitionContext context, CloseReason reason) at Microsoft.Azure.EventHubs.Processor.PartitionPump.CloseAsync(CloseReason reason)

我们正在使用 Microsoft.Azure.EventHubs v4.3.0 和 Microsoft.Azure.EventHubs.Processor v4.3.0

我们担心在这种情况下,不会写入任何检查点,并且在处理器重新启动时,由于无法保存最近的检查点位置,将会出现大量重复项。 有没有办法了解导致故障的原因以及如何修复它们?

最佳答案

抱歉给您带来麻烦。修复程序将于本周在 4.3.1 版本中发布。

关于Azure 事件中心 - IEventProcessor 的 CloseAsync 中的 LeaseLostException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64537896/

相关文章:

c# - 如何将消息从 eventhub 发送到另一个 eventhub?

.net - Azure 最快的通信协议(protocol)

java - Flink 1.9.1 无法再连接到 Azure Event Hub

Azure Spring Cloud 和 JHipster

python - 将新文本数据添加到 Azure 中的现有 Blob

azure - 将数据从函数提取到事件中心、Azure 数据资源管理器?

c# - EventProcessorClient 事件之间的延迟

c# - 带有 eventData 对象的 EventHubTrigger C# 不起作用

azure - 创建AD用户并同时添加到组?

azure - 在 Azure 应用服务上运行部署后操作