azure-webjobs-sdk
azure-webjobs-sdk copied to clipboard
Missing cache for WebJobsOptionsFactory
The options cache is not being passed into WebJobsOptionsFactory, so every time we go through language worker setup we end up creating multiple instances of the options.
Expected behaviour
- Start the function host
- Host reads the worker.config file and creates options at the parent scope
- JobHost process starts up
- Host reads the worker.config file and creates options at the child scope
- Make a change that causes use to read the worker config
- Host uses existing options instance
Overall, only two instances of worker options should be created, and future uses of options should use the cache.
Actual behaviour
- Start the function host
- Host reads the worker.config file and creates options at the parent scope
- JobHost process starts up
- Host reads the worker.config file and creates options at the child scope
- Make a change that causes use to read the worker config
- Host creates a new options instance instead of using the cache
Three instances of worker options are created, when instead we should be using the cache
Steps to reproduce
- Add breakpoint at LanguageWorkerOptionsSetup.cs
- This breakpoint is being hit 3 times.
- Adding this object to watch and creating an object ID shows us 2 objects are same and 1 is different
@liliankasem can we please add information about the expected vs actual behavior here so others know how to validate this issue? Thanks!