{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/Caching/issues/293","repository_url":"https://api.github.com/repos/aspnet/Caching","labels_url":"https://api.github.com/repos/aspnet/Caching/issues/293/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Caching/issues/293/comments","events_url":"https://api.github.com/repos/aspnet/Caching/issues/293/events","html_url":"https://github.com/aspnet/Caching/issues/293","id":220947076,"number":293,"title":"Calling RedisCache GetAsync fails on second call in ViewComponent that is rendered in PartialView","user":{"login":"rangp","id":8915141,"avatar_url":"https://avatars1.githubusercontent.com/u/8915141?v=4","gravatar_id":"","url":"https://api.github.com/users/rangp","html_url":"https://github.com/rangp","followers_url":"https://api.github.com/users/rangp/followers","following_url":"https://api.github.com/users/rangp/following{/other_user}","gists_url":"https://api.github.com/users/rangp/gists{/gist_id}","starred_url":"https://api.github.com/users/rangp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rangp/subscriptions","organizations_url":"https://api.github.com/users/rangp/orgs","repos_url":"https://api.github.com/users/rangp/repos","events_url":"https://api.github.com/users/rangp/events{/privacy}","received_events_url":"https://api.github.com/users/rangp/received_events","type":"User","site_admin":false},"labels":[{"id":536174207,"url":"https://api.github.com/repos/aspnet/Caching/labels/Investigate","name":"Investigate","color":"e580c2","default":false},{"id":117884895,"url":"https://api.github.com/repos/aspnet/Caching/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-04-11T13:12:54Z","updated_at":"2018-05-02T03:00:29Z","closed_at":"2018-01-03T19:13:12Z","author_association":"NONE","body":"I just encountered a weird bug that was hard to isolate, but it seems that the redis implementation of IDistributedCache becomes trapped in a deadlock when `GetAsync` is called in a `ViewComponent` that is rendered from a `PartialView`, not on the first call but on the second. Instead of returning the expected `byte[]` the call will run forever, or at least until the timeout is reached and the connection is aborted. \r\n\r\nSteps to reproduce:\r\n1. app.UseRedisDistributedCache\r\n2. Set any value into the cache\r\n3. Try to access that value in a ViewComponent's `InvokeAsync` method\r\n4. Render the `ViewComponent` in a `PartialView` and render that `PartialView` in a full razor page.\r\n5. Navigate to the page that contains the `PartialView` and reload twice.\r\n\r\nOn the second reload the timeout should occur. \r\n\r\nI created a demo project to demonstrate the bug (see https://github.com/rangp/RedisCachingBug) After starting the application and reloading once the timeout should happen. Please note that the application expects redis to run on localhost without authentication. However I recreated the bug on an azure environment using an azure redis server with authentication, thus it's not restricted to a local environment.\r\n\r\nAlso weird: The synchronous method `Get` runs without problems. This is really freaking me out, because I have no clue what the cause of this issue could be. I also tried to run several other asynchronous methods in the same manner, including `HttpClient.GetAsync` etc. but only the redis cache `GetAsync` produces a timeout.\r\n\r\n(Edit: I'm running the application on a windows 10 machine and have ran it on an azure web app)"},"comment":{"url":"https://api.github.com/repos/aspnet/Caching/issues/comments/385851435","html_url":"https://github.com/aspnet/Caching/issues/293#issuecomment-385851435","issue_url":"https://api.github.com/repos/aspnet/Caching/issues/293","id":385851435,"user":{"login":"ansario","id":7139741,"avatar_url":"https://avatars0.githubusercontent.com/u/7139741?v=4","gravatar_id":"","url":"https://api.github.com/users/ansario","html_url":"https://github.com/ansario","followers_url":"https://api.github.com/users/ansario/followers","following_url":"https://api.github.com/users/ansario/following{/other_user}","gists_url":"https://api.github.com/users/ansario/gists{/gist_id}","starred_url":"https://api.github.com/users/ansario/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansario/subscriptions","organizations_url":"https://api.github.com/users/ansario/orgs","repos_url":"https://api.github.com/users/ansario/repos","events_url":"https://api.github.com/users/ansario/events{/privacy}","received_events_url":"https://api.github.com/users/ansario/received_events","type":"User","site_admin":false},"created_at":"2018-05-02T03:00:29Z","updated_at":"2018-05-02T03:00:29Z","author_association":"NONE","body":"@muratg it looks like this is still an issue using IDistributedCache in .NET Core 2.0."}}
{"actor":{"display_login":"ansario"}}