{"action":"created","issue":{"url":"https://api.github.com/repos/Azure/azure-functions-durable-extension/issues/367","repository_url":"https://api.github.com/repos/Azure/azure-functions-durable-extension","labels_url":"https://api.github.com/repos/Azure/azure-functions-durable-extension/issues/367/labels{/name}","comments_url":"https://api.github.com/repos/Azure/azure-functions-durable-extension/issues/367/comments","events_url":"https://api.github.com/repos/Azure/azure-functions-durable-extension/issues/367/events","html_url":"https://github.com/Azure/azure-functions-durable-extension/issues/367","id":336639495,"node_id":"MDU6SXNzdWUzMzY2Mzk0OTU=","number":367,"title":"Add support for atomic StartNewAsync that would execute only if instance is not already running (for singleton orchestrator support)","user":{"login":"SimonLuckenuik","id":13141534,"node_id":"MDQ6VXNlcjEzMTQxNTM0","avatar_url":"https://avatars3.githubusercontent.com/u/13141534?v=4","gravatar_id":"","url":"https://api.github.com/users/SimonLuckenuik","html_url":"https://github.com/SimonLuckenuik","followers_url":"https://api.github.com/users/SimonLuckenuik/followers","following_url":"https://api.github.com/users/SimonLuckenuik/following{/other_user}","gists_url":"https://api.github.com/users/SimonLuckenuik/gists{/gist_id}","starred_url":"https://api.github.com/users/SimonLuckenuik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SimonLuckenuik/subscriptions","organizations_url":"https://api.github.com/users/SimonLuckenuik/orgs","repos_url":"https://api.github.com/users/SimonLuckenuik/repos","events_url":"https://api.github.com/users/SimonLuckenuik/events{/privacy}","received_events_url":"https://api.github.com/users/SimonLuckenuik/received_events","type":"User","site_admin":false},"labels":[{"id":735546911,"node_id":"MDU6TGFiZWw3MzU1NDY5MTE=","url":"https://api.github.com/repos/Azure/azure-functions-durable-extension/labels/dtfx","name":"dtfx","color":"52c7f9","default":false},{"id":618529386,"node_id":"MDU6TGFiZWw2MTg1MjkzODY=","url":"https://api.github.com/repos/Azure/azure-functions-durable-extension/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":618529387,"node_id":"MDU6TGFiZWw2MTg1MjkzODc=","url":"https://api.github.com/repos/Azure/azure-functions-durable-extension/labels/help%20wanted","name":"help wanted","color":"128A0C","default":true},{"id":666285645,"node_id":"MDU6TGFiZWw2NjYyODU2NDU=","url":"https://api.github.com/repos/Azure/azure-functions-durable-extension/labels/needs-discussion","name":"needs-discussion","color":"fef2c0","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/Azure/azure-functions-durable-extension/milestones/6","html_url":"https://github.com/Azure/azure-functions-durable-extension/milestone/6","labels_url":"https://api.github.com/repos/Azure/azure-functions-durable-extension/milestones/6/labels","id":3336650,"node_id":"MDk6TWlsZXN0b25lMzMzNjY1MA==","number":6,"title":"Durable Functions v2.0 release","description":"This milestone represents a major version update. Breaking changes will be permitted. TBD whether we will continue to support Azure Functions v1.0 in this release.","creator":{"login":"cgillum","id":2704139,"node_id":"MDQ6VXNlcjI3MDQxMzk=","avatar_url":"https://avatars2.githubusercontent.com/u/2704139?v=4","gravatar_id":"","url":"https://api.github.com/users/cgillum","html_url":"https://github.com/cgillum","followers_url":"https://api.github.com/users/cgillum/followers","following_url":"https://api.github.com/users/cgillum/following{/other_user}","gists_url":"https://api.github.com/users/cgillum/gists{/gist_id}","starred_url":"https://api.github.com/users/cgillum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cgillum/subscriptions","organizations_url":"https://api.github.com/users/cgillum/orgs","repos_url":"https://api.github.com/users/cgillum/repos","events_url":"https://api.github.com/users/cgillum/events{/privacy}","received_events_url":"https://api.github.com/users/cgillum/received_events","type":"User","site_admin":false},"open_issues":21,"closed_issues":1,"state":"open","created_at":"2018-05-10T17:13:43Z","updated_at":"2018-10-11T00:43:51Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2018-06-28T14:13:08Z","updated_at":"2018-10-11T22:04:21Z","closed_at":null,"author_association":"NONE","body":"Could we add an atomic \"StartNewAsyncIfNotRunningOrCompletedOrInError\" ( name to rework ;-) )? If the instance already exists, keep it running, if not ignore the start request and notify that it was already running.\r\n\r\nCurrently, we have to check the status, and if not running than start it, which is not concurrency friendly at all (could easily have 2 requests starting the workflow).\r\n\r\nI really want something like that for singleton orchestrator scenarios (example: a workflow singleton is started for each user identifier).\r\n\r\nOther way would be to have support for Singleton (https://github.com/Azure/azure-functions-host/issues/912) with the consumption plan so that I can safety check the status and call StartNewAsync om the same concurrency safe scope."},"comment":{"url":"https://api.github.com/repos/Azure/azure-functions-durable-extension/issues/comments/429134588","html_url":"https://github.com/Azure/azure-functions-durable-extension/issues/367#issuecomment-429134588","issue_url":"https://api.github.com/repos/Azure/azure-functions-durable-extension/issues/367","id":429134588,"node_id":"MDEyOklzc3VlQ29tbWVudDQyOTEzNDU4OA==","user":{"login":"cgillum","id":2704139,"node_id":"MDQ6VXNlcjI3MDQxMzk=","avatar_url":"https://avatars2.githubusercontent.com/u/2704139?v=4","gravatar_id":"","url":"https://api.github.com/users/cgillum","html_url":"https://github.com/cgillum","followers_url":"https://api.github.com/users/cgillum/followers","following_url":"https://api.github.com/users/cgillum/following{/other_user}","gists_url":"https://api.github.com/users/cgillum/gists{/gist_id}","starred_url":"https://api.github.com/users/cgillum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cgillum/subscriptions","organizations_url":"https://api.github.com/users/cgillum/orgs","repos_url":"https://api.github.com/users/cgillum/repos","events_url":"https://api.github.com/users/cgillum/events{/privacy}","received_events_url":"https://api.github.com/users/cgillum/received_events","type":"User","site_admin":false},"created_at":"2018-10-11T22:04:21Z","updated_at":"2018-10-11T22:04:21Z","author_association":"COLLABORATOR","body":"I just want to update this issue so to clarify what happens today and what I think we need to do for the final implementation:\r\n1. StartNewAsync will always create a new instance, whether the ID is in use or not. If the ID is in use, that instance will be silently overwritten. We should change this behavior (though it is a breaking change). In order to make it thread-safe, we will need to also include a change in **DurableTask.AzureStorage**.\r\n\r\n2. StartNewAsync will recreated terminated, failed, or completed instances of a specified ID if it already exists. I think we should preserve this behavior moving forward. \r\n\r\n3. Orchestrator-specific messages like StartNewAsync are already affinitized to a particular worker instance, so even if things are scaled out, only a single worker would process duplicate messages. The exception to this is if there is a lease failover, it's possible that these messages may arrive on different VMs. Any logic we do for dup-detection/overwriting will need to use the appropriate synchronization mechanisms (e.g. eTags) to ensure that we get the correct behavior in all cases."}}
{"actor":{"display_login":"cgillum"}}