{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/orleans/issues/901","labels_url":"https://api.github.com/repos/dotnet/orleans/issues/901/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/orleans/issues/901/comments","events_url":"https://api.github.com/repos/dotnet/orleans/issues/901/events","html_url":"https://github.com/dotnet/orleans/issues/901","id":111187206,"number":901,"title":"Bug in implicit streams rewinding","user":{"login":"randa1","id":3209338,"avatar_url":"https://avatars.githubusercontent.com/u/3209338?v=3","gravatar_id":"","url":"https://api.github.com/users/randa1","html_url":"https://github.com/randa1","followers_url":"https://api.github.com/users/randa1/followers","following_url":"https://api.github.com/users/randa1/following{/other_user}","gists_url":"https://api.github.com/users/randa1/gists{/gist_id}","starred_url":"https://api.github.com/users/randa1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/randa1/subscriptions","organizations_url":"https://api.github.com/users/randa1/orgs","repos_url":"https://api.github.com/users/randa1/repos","events_url":"https://api.github.com/users/randa1/events{/privacy}","received_events_url":"https://api.github.com/users/randa1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"jason-bragg","id":10675494,"avatar_url":"https://avatars.githubusercontent.com/u/10675494?v=3","gravatar_id":"","url":"https://api.github.com/users/jason-bragg","html_url":"https://github.com/jason-bragg","followers_url":"https://api.github.com/users/jason-bragg/followers","following_url":"https://api.github.com/users/jason-bragg/following{/other_user}","gists_url":"https://api.github.com/users/jason-bragg/gists{/gist_id}","starred_url":"https://api.github.com/users/jason-bragg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jason-bragg/subscriptions","organizations_url":"https://api.github.com/users/jason-bragg/orgs","repos_url":"https://api.github.com/users/jason-bragg/repos","events_url":"https://api.github.com/users/jason-bragg/events{/privacy}","received_events_url":"https://api.github.com/users/jason-bragg/received_events","type":"User","site_admin":false},"milestone":null,"comments":5,"created_at":"2015-10-13T14:05:00Z","updated_at":"2015-10-17T22:54:13Z","closed_at":null,"body":"We're using implicit streams subscriptions with our own stream provider implemented on top of `PersistentStreamProvider`, and it seems there's a bug when an implicit consumer re-subscribes to a certain position in the stream.\r\n\r\nThis is my test scenario:\r\n* 1 producer, 1 implicit consumer\r\n* Producer produces 5 messages\r\n* Consumer finishes consuming all 5 messages\r\n* Consumer unsubscribes and re-subscribes with a sequence token of the 3rd message\r\n\r\nExpected result: Messages 3-5 are re-consumed immediately \r\nActual result: No messages are consumed **until a new message is produced**. Only if we produce another message (the 6th), the consumer \"wakes up\" and re-consumes messages 3-5 and then 6.\r\n\r\nIn explicit streams it works as expected. Note that I've verified all of the 5 messages are still in the `QueueCache`.\r\n\r\nI've dug in the source code and it seems the problem is that with explicit streams, `IStreamPubSub`'s `RegisterConsumer` method calls the producer (the `PersistentStreamPullingAgent` in our case) and refreshes the cursors. In the `ImplicitStreamPubSub` the `RegisterConsumer` method does nothing.\r\n\r\nHow can this be solved?"},"comment":{"url":"https://api.github.com/repos/dotnet/orleans/issues/comments/148958623","html_url":"https://github.com/dotnet/orleans/issues/901#issuecomment-148958623","issue_url":"https://api.github.com/repos/dotnet/orleans/issues/901","id":148958623,"user":{"login":"gabikliot","id":10171207,"avatar_url":"https://avatars.githubusercontent.com/u/10171207?v=3","gravatar_id":"","url":"https://api.github.com/users/gabikliot","html_url":"https://github.com/gabikliot","followers_url":"https://api.github.com/users/gabikliot/followers","following_url":"https://api.github.com/users/gabikliot/following{/other_user}","gists_url":"https://api.github.com/users/gabikliot/gists{/gist_id}","starred_url":"https://api.github.com/users/gabikliot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabikliot/subscriptions","organizations_url":"https://api.github.com/users/gabikliot/orgs","repos_url":"https://api.github.com/users/gabikliot/repos","events_url":"https://api.github.com/users/gabikliot/events{/privacy}","received_events_url":"https://api.github.com/users/gabikliot/received_events","type":"User","site_admin":false},"created_at":"2015-10-17T22:54:13Z","updated_at":"2015-10-17T22:54:13Z","body":"Can we please rename this issue to delayed implicit streams rewinding. Bug doesn't mean much."}}