首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Azure函数: Error: 409 LeaseIdMismatchWithLeaseOperation (侦听器)

Azure函数: Error: 409 LeaseIdMismatchWithLeaseOperation (侦听器)
EN

Stack Overflow用户
提问于 2020-07-24 05:57:54
回答 2查看 5.4K关注 0票数 1

我们正在使用Azure函数(V2 -消费计划)。偶尔(也许每天一次或两次),我们会得到以下一系列错误。

我试着在谷歌上搜索,想办法解决这个问题--但目前还没有成功。

知道我能怎么解决吗?有什么错误是我应该关心的吗?或者接受错误是正常的?

代码语言:javascript
运行
复制
Singleton lock renewal failed for blob 'xxxxxxx/xxxxx.xxxx.RunAsync.Listener' with error code 409: LeaseIdMismatchWithLeaseOperation. The last successful renewal completed at 2020-07-24T05:00:16.732Z (33347 milliseconds ago) with a duration of 4 milliseconds. The lease period was 15000 milliseconds.

伴随着这个错误

代码语言:javascript
运行
复制
Exception: Microsoft.Azure.Storage.StorageException: The lease ID specified did not match the lease ID for the blob.
at Microsoft.Azure.Storage.Core.Executor.Executor.ExecuteAsync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext, CancellationToken token)
at Microsoft.Azure.WebJobs.Host.StorageBaseDistributedLockManager.SingletonLockHandle.RenewAsync(ILogger logger, CancellationToken cancellationToken) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host.Storage\Singleton\BlobLeaseDistributedLockManager.cs:line 348
at Microsoft.Azure.WebJobs.Host.SingletonManager.RenewLeaseCommand.ExecuteAsync(CancellationToken cancellationToken) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Singleton\SingletonManager.cs:line 332
at Microsoft.Azure.WebJobs.Host.Timers.TaskSeriesTimer.RunAsync(CancellationToken cancellationToken) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Timers\TaskSeriesTimer.cs:line 147
Request Information
RequestID:708f6f2f-d01e-013a-1677-xxxxxxx
RequestDate:Fri, 24 Jul 2020 05:00:48 GMT
StatusMessage:The lease ID specified did not match the lease ID for the blob.
ErrorCode:LeaseIdMismatchWithLeaseOperation
ErrorMessage:The lease ID specified did not match the lease ID for the blob. RequestId:708f6f2f-d01e-013a-1677-xxxxx Time:2020-07-24T05:00:48.4767302Z
EN

回答 2

Stack Overflow用户

发布于 2020-07-24 07:36:57

这似乎是一个长期存在的问题。我检查了一些类似的问题。虽然我没有找到解决方案,但这个回答似乎解决了我的一些困惑:

造成这种情况的原因几乎总是由于函数阻塞线程,从而阻止我们的租约续订计时器触发,因此租约意外地过期。对于这个问题,我的建议是评估您的函数代码是否存在潜在的线程问题--确保它在任何可能的地方都使用异步,而不阻塞任何线程。

票数 2
EN

Stack Overflow用户

发布于 2022-06-26 06:11:34

在我的例子中,运行在不同线程中的一些逻辑抛出了一个异常。因此,我删除了多线程,错误消息再次可读性。

如果在Kubernetes中运行Azure函数,则host.json中有一个host.json变量,可以将其设置为-1,这意味着没有超时。这并不是为了库伯奈特的目的正式记录下来的,但对我来说是有效的。

此外,请确保使用Singleton注释,以便该函数不会并行执行。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63067676

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档