Azure 服务总线/函数应用程序队列消息入队/出队行为

Azure 服务总线/函数应用程序队列消息入队/出队行为

我们使用 Azure 服务总线和 Azure 函数应用组件进行软件后端操作。最近我们注意到 App Insights 中出现了一些错误。我们注意到,即使在传递消息 lock end DateTime 后,一些函数应用操作仍会启动。请参阅以下日志以获取示例。操作是在2022年2月10日 上午8:46:06.999,但队列消息锁定已结束于2022-02-10,08:46:04.5640000Z

有人遇到过这种情况并能提供一些见解吗?

我们正在使用标准定价层的硬件/组件,这可能是发生这种情况的原因。提前致谢。

2/10/2022, 8:46:06.999 AM   Trigger Details: MessageId: 9b4759453fab437fa1c995fce5fb928f, SequenceNumber: 8956, DeliveryCount: 1, EnqueuedTimeUtc: 2022-02-10T08:45:34.5480000Z, LockedUntilUtc: 2022-02-10T08:46:04.5640000Z, SessionId: (null)    Information 
2/10/2022, 8:46:06.999 AM   Executing 'Functions....' (Reason='(null)', Id=7e4644f3-9960-4a5e-af58-515b91008a56)
...
2/10/2022, 8:46:07.031 AM   Start processing HTTP request POST ...  Information 
2/10/2022, 8:46:07.031 AM   Sending HTTP request POST ...   Information 
...
2/10/2022, 8:46:07.311 AM   Message processing error (Action=RenewLock, ClientId=MessageReceiver3..., EntityPath=..., Endpoint=...) Error   
2/10/2022, 8:46:07.311 AM       Error   
2/10/2022, 8:46:07.341 AM   Received HTTP response headers after 238.6766ms - 200   Information 
...
2/10/2022, 8:46:07.351 AM   Executed 'Functions....' (Succeeded, Id=7e4644f3-9960-4a5e-af58-515b91008a56, Duration=351ms)
2/10/2022, 8:46:07.872 AM       Error   
2/10/2022, 8:46:07.872 AM   Message processing error (Action=Complete, ClientId=MessageReceiver3..., EntityPath=..., Endpoint=...)  Error   
2/10/2022, 8:46:10.965 AM   Executing 'Functions....' (Reason='(null)', Id=5068f09b-3f74-4d72-a751-6fb8044cfd47)    Information 
2/10/2022, 8:46:10.965 AM   Trigger Details: MessageId: 9b4759453fab437fa1c995fce5fb928f, SequenceNumber: 8956, DeliveryCount: 2, EnqueuedTimeUtc: 2022-02-10T08:45:34.5480000Z, LockedUntilUtc: 2022-02-10T08:46:34.5220000Z, SessionId: (null)    Information 
...
2/10/2022, 8:46:12.363 AM   Sending HTTP request POST ...   Information 
2/10/2022, 8:46:12.363 AM   Start processing HTTP request POST ...  Information 
2/10/2022, 8:46:12.373 AM   FunctionName ended for transaction: { "abc": 111 }  Information 
2/10/2022, 8:46:12.373 AM   Received HTTP response headers after 99.4662ms - 200    Information 
2/10/2022, 8:46:12.373 AM   End processing HTTP request after 99.5389ms - 200   Information 
2/10/2022, 8:46:12.373 AM   Executed 'Functions....' (Succeeded, Id=5068f09b-3f74-4d72-a751-6fb8044cfd47, Duration=1408ms)  Information

答案1

如果你的函数有相当高的prefetchCount处理需要一些时间,但时间很短MaxLockDuration。预取的消息不是在处理时开始计时,而是在提取时开始计时。尝试提升MaxLockDuration和调整prefetchCount以摆脱此问题。

相关内容