If index is stale we may miss timeouts, fixes #2133

Simplify querying for timeouts, and introduce cleaning-up abilities to guarantee we don't skip any timeouts

Further avoid duplicates by better cleanup logic

Adding failing tests demonstrating skipped timeouts
Yea, that was my thinking. We could make it internal and guide users to get at it via reflection if they need to disable the cleanup?

Sent from my iPhone

> On 11 Jul 2014, at 01:49, Itamar Syn-Hershko <notifications@github.com> wrote:
> 
> In src/NServiceBus.Core/Persistence/Raven/TimeoutPersister/RavenTimeoutPersistence.cs:
> 
> > @@ -14,9 +14,50 @@ public class RavenTimeoutPersistence : IPersistTimeouts
> >      {
> >          readonly IDocumentStore store;
> >  
> > -        public RavenTimeoutPersistence(StoreAccessor  storeAccessor)
> > +        public TimeSpan CleanupGapFromTimeslice { get; set; }
> @andreasohlund wanted to have this configurable, and it's also being set from tests to ensure cleanup isn't kicked in automatically so we can take control of it. It isn't a change to the interface and only something that is being used internally , so I think it's good
> 
> —
> Reply to this email directly or view it on GitHub.