Open brettsam opened 6 years ago
Yes, the metadata I put in place for singleton initially wasn't targeted for listener level locks but function locks. The metadata is used to show in the Dashboard which function instance (not app instance) is currently holding the lock.
It would be good to also add the app instance ID to this metadata.
The function host blob lease mechanism does this today and it'd be useful to share that code. There are cases where a hardcoded host id means that timers are running on a local machine running the CLI and nothing in Azure is able to run.
This currently doesn't happen in the case of
TimerTrigger
because theSingletonListener
passes null as thefunctionInstanceId
: https://github.com/Azure/azure-webjobs-sdk/blob/bd2d9ea34f13fc16569e8d8f80bafdb605eeb6f9/src/Microsoft.Azure.WebJobs.Host/Singleton/SingletonListener.cs#L48The writing of metadata is handled here: https://github.com/Azure/azure-webjobs-sdk/blob/bd2d9ea34f13fc16569e8d8f80bafdb605eeb6f9/src/Microsoft.Azure.WebJobs.Host/Singleton/BlobLeaseDistributedLockManager.cs#L278-L287