{"action":"created","issue":{"url":"https://api.github.com/repos/ExtCore/ExtCore/issues/123","repository_url":"https://api.github.com/repos/ExtCore/ExtCore","labels_url":"https://api.github.com/repos/ExtCore/ExtCore/issues/123/labels{/name}","comments_url":"https://api.github.com/repos/ExtCore/ExtCore/issues/123/comments","events_url":"https://api.github.com/repos/ExtCore/ExtCore/issues/123/events","html_url":"https://github.com/ExtCore/ExtCore/issues/123","id":327654106,"node_id":"MDU6SXNzdWUzMjc2NTQxMDY=","number":123,"title":"Concurrency issues in GetImplementations caching mechanism","user":{"login":"PTwr","id":20748035,"node_id":"MDQ6VXNlcjIwNzQ4MDM1","avatar_url":"https://avatars1.githubusercontent.com/u/20748035?v=4","gravatar_id":"","url":"https://api.github.com/users/PTwr","html_url":"https://github.com/PTwr","followers_url":"https://api.github.com/users/PTwr/followers","following_url":"https://api.github.com/users/PTwr/following{/other_user}","gists_url":"https://api.github.com/users/PTwr/gists{/gist_id}","starred_url":"https://api.github.com/users/PTwr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PTwr/subscriptions","organizations_url":"https://api.github.com/users/PTwr/orgs","repos_url":"https://api.github.com/users/PTwr/repos","events_url":"https://api.github.com/users/PTwr/events{/privacy}","received_events_url":"https://api.github.com/users/PTwr/received_events","type":"User","site_admin":false},"labels":[{"id":298524210,"node_id":"MDU6TGFiZWwyOTg1MjQyMTA=","url":"https://api.github.com/repos/ExtCore/ExtCore/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-05-30T09:45:23Z","updated_at":"2018-06-08T11:02:16Z","closed_at":"2018-06-08T10:54:02Z","author_association":"NONE","body":"Multiple calls to GetImplementations from bunch to background tasks running on app start leads to `System.ArgumentException: 'An item with the same key has already been added.` when `useCaching = true`.\r\n\r\nBetween querying cache and filling it with obtained types other threads seem to finish first so `Add()` on dict fails with exception.\r\n\r\nSwitching to `ConcurentDictionary` might take care of this issue, something like this:\r\n\r\nhttps://github.com/PTwr/ExtCore/commit/5c4096936f5c2118b379da2a5d15990b16f0e791#diff-4145a0ed1b7433005dde69197e020266\r\n\r\nhowever some lock&wait might be in order to avoid molesting all Assemblies needlessly.\r\n\r\nAnother possible solution might be prefetching `GetExportedTypes()` on initialization, for example in `UseExtCore()` with option to reload/append to it in case #43 is implemented."},"comment":{"url":"https://api.github.com/repos/ExtCore/ExtCore/issues/comments/395727409","html_url":"https://github.com/ExtCore/ExtCore/issues/123#issuecomment-395727409","issue_url":"https://api.github.com/repos/ExtCore/ExtCore/issues/123","id":395727409,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NTcyNzQwOQ==","user":{"login":"DmitrySikorsky","id":6570196,"node_id":"MDQ6VXNlcjY1NzAxOTY=","avatar_url":"https://avatars1.githubusercontent.com/u/6570196?v=4","gravatar_id":"","url":"https://api.github.com/users/DmitrySikorsky","html_url":"https://github.com/DmitrySikorsky","followers_url":"https://api.github.com/users/DmitrySikorsky/followers","following_url":"https://api.github.com/users/DmitrySikorsky/following{/other_user}","gists_url":"https://api.github.com/users/DmitrySikorsky/gists{/gist_id}","starred_url":"https://api.github.com/users/DmitrySikorsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DmitrySikorsky/subscriptions","organizations_url":"https://api.github.com/users/DmitrySikorsky/orgs","repos_url":"https://api.github.com/users/DmitrySikorsky/repos","events_url":"https://api.github.com/users/DmitrySikorsky/events{/privacy}","received_events_url":"https://api.github.com/users/DmitrySikorsky/received_events","type":"User","site_admin":false},"created_at":"2018-06-08T11:02:16Z","updated_at":"2018-06-08T11:02:16Z","author_association":"MEMBER","body":"Bug is fixed (using your solution).\r\n\r\nWhat about using ExtensionManager as a service. Hm. The only issue I see is that we use on early stages, so not all the services can be registered when you request it from the ServiceProvider. For example,  here: https://github.com/ExtCore/ExtCore/blob/master/src/ExtCore.Data/Actions/AddStorageAction.cs#L37\r\n\r\nWhat do you think about that?"}}
{"actor":{"display_login":"DmitrySikorsky"}}