{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/orleans/issues/1646","repository_url":"https://api.github.com/repos/dotnet/orleans","labels_url":"https://api.github.com/repos/dotnet/orleans/issues/1646/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/orleans/issues/1646/comments","events_url":"https://api.github.com/repos/dotnet/orleans/issues/1646/events","html_url":"https://github.com/dotnet/orleans/issues/1646","id":146029234,"number":1646,"title":"Question: Can Orleans grain Logger be used in multi-threaded scenario?","user":{"login":"Eldar1205","id":5265591,"avatar_url":"https://avatars.githubusercontent.com/u/5265591?v=3","gravatar_id":"","url":"https://api.github.com/users/Eldar1205","html_url":"https://github.com/Eldar1205","followers_url":"https://api.github.com/users/Eldar1205/followers","following_url":"https://api.github.com/users/Eldar1205/following{/other_user}","gists_url":"https://api.github.com/users/Eldar1205/gists{/gist_id}","starred_url":"https://api.github.com/users/Eldar1205/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eldar1205/subscriptions","organizations_url":"https://api.github.com/users/Eldar1205/orgs","repos_url":"https://api.github.com/users/Eldar1205/repos","events_url":"https://api.github.com/users/Eldar1205/events{/privacy}","received_events_url":"https://api.github.com/users/Eldar1205/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-04-05T15:45:56Z","updated_at":"2016-04-05T18:24:20Z","closed_at":"2016-04-05T18:24:19Z","body":"I have a grain that does parallel async I/O operations, calls to other grains, and I want to run them with retries. If some tries fail, I'd like to use the grain's `Logger ` to log a warning. Since the grain requests run in parallel, and it's important that remains that way, the question is can the `Logger ` be used in that parallel context? \r\n\r\nI looked at `TrackTrace `method and other telemetry consumers delegation methods, and they are thread-safe (assuming the consumers are, which they should since they are practically singletons), while the `Log `method isn't (modifies a non-thread safe dictionary). Can I assume that the Logger is by-design thread-safe while using the `TrackXXX` APIs and telemetry consumers on the other end? If that's the case, is it officially documented as part of the framework behaviour the application can rely on?"},"comment":{"url":"https://api.github.com/repos/dotnet/orleans/issues/comments/205930707","html_url":"https://github.com/dotnet/orleans/issues/1646#issuecomment-205930707","issue_url":"https://api.github.com/repos/dotnet/orleans/issues/1646","id":205930707,"user":{"login":"Eldar1205","id":5265591,"avatar_url":"https://avatars.githubusercontent.com/u/5265591?v=3","gravatar_id":"","url":"https://api.github.com/users/Eldar1205","html_url":"https://github.com/Eldar1205","followers_url":"https://api.github.com/users/Eldar1205/followers","following_url":"https://api.github.com/users/Eldar1205/following{/other_user}","gists_url":"https://api.github.com/users/Eldar1205/gists{/gist_id}","starred_url":"https://api.github.com/users/Eldar1205/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eldar1205/subscriptions","organizations_url":"https://api.github.com/users/Eldar1205/orgs","repos_url":"https://api.github.com/users/Eldar1205/repos","events_url":"https://api.github.com/users/Eldar1205/events{/privacy}","received_events_url":"https://api.github.com/users/Eldar1205/received_events","type":"User","site_admin":false},"created_at":"2016-04-05T18:24:19Z","updated_at":"2016-04-05T18:24:19Z","body":"I re-read carefully the grains turn based concurrency carefully and now understand that the awaited tasks running inside the `RetyWithLinearPolicyAsync` will be executed by Orleans task scheduler which ensures the single concurrency model. Thanks for your help :)"}}