Azure / Azure/azure-functions-host
Backoff and retry reading host.json if file is locked
- Dominant language
- C#
- Stars
- 2k
- Forks
- 482
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 36
Description
It can be possible, while *not* using RunFromPackage, for the host to get into a race during a file change event and get an exception like
```
The process cannot access the file 'C:\home\site\wwwroot\host.json' because it is being used by another process.
```
This is an `IOException`, which is not something we handle during our reading of the host.json file. It seems like we could implement a small backoff retry here and see if we can recover from this.
That being said, this may not be high priority unless we see a wave of these complaints. Moving to RunFromPackage (which is the default and highly recommended deployment method) prevents any of these file changes from happening anyway.
Contributor guide
Research direction
Start by locating the host.json reading path and the handling around IOException during a file change event. Check how RunFromPackage affects file changes and use the reported locked-file scenario to verify that a small backoff and retry recovers successfully; done means the host no longer fails on this transient read exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp
- Domain
- backend, cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100