Azure / Azure/azure-functions-dotnet-worker
Message frequently getting into service bus dead letter queue after migrating Azure function from in-process to Isolated model
- Dominant language
- C#
- Stars
- 466
- Forks
- 215
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 7
Description
### Description
After migrating the Azure function (using service bus trigger) from inprocess to .NET Isolated model (v9 or v10), the message from service bus frequently gets into the dead letter queue due to Service bus lock lost exception despite the message processing only take less than 1 sec. Moreover the lock renewal is set to "maxAutoLockRenewalDuration": "01:05:00", "functionTimeout": "01:00:00". But the issue happens still.
I am seeing both the cases below due to message lock lost exception
1. Messages still in queue and not picked, but moved to DL queue
2. Messages gets picked and in the mid of processing it gets moved to DL queue
Previously this Azure function was running under .NET v6 in-process model with no issues but after migrating to .NET 10 Isolated Model, I am seeing this issue frequently.
Do you know what else could cause the issue ?
Also I observed the following.
Even though the service bus extension configured in the .csproj is 5.24.0, the extension that shows under the Function app Diagnose & solve problems is 5.17.0.0.
Below is the host.json values:
"extensions": {
"serviceBus": {
"clientRetryOptions": {
"mode": "exponential",
"tryTimeout": "00:01:00",
"delay": "00:00:00.80",
"maxDelay": "00:01:00",
"maxRetries": 3
},
// "prefetchCount": 1,
"autoCompleteMessages": true,
"maxAutoLockRenewalDuration": "01:05:00",
"maxConcurrentCalls": 20,
"maxConcurrentSessions": 100,
//"maxMessages": 1000,
"sessionIdleTimeout": "00:01:00"
}
},
"concurrency": {
"dynamicConcurrencyEnabled": false,
"snapshotPersistenceEnabled": true
},
"functions": [
],
"functionTimeout": "01:00:00"
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reviewing the .csproj package references and host.json service bus settings, then compare the configured extension version with the 5.17.0.0 version shown in Function App Diagnose & solve problems. Reproduce both reported dead-letter cases and determine whether the migration or version mismatch explains the lock-lost behavior; done means documenting a confirmed cause and actionable resolution.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp
- Domain
- backend, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100