-
Notifications
You must be signed in to change notification settings - Fork 537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When first and last cycle are out of date, should we try refreshing them and retrying before we throw? #913
Comments
@JerryShea @nicktindall
In normal flow, when files are not manually moved, shared variable |
I think the scenario we saw was in Chronicle-Queue/src/main/java/net/openhft/chronicle/queue/impl/single/StoreTailer.java Lines 887 to 891 in db7a1ec
It's also repeated in Chronicle-Queue/src/main/java/net/openhft/chronicle/queue/impl/single/StoreTailer.java Lines 748 to 752 in db7a1ec
but that seems to be retried already Chronicle-Queue/src/main/java/net/openhft/chronicle/queue/impl/single/StoreTailer.java Lines 768 to 775 in db7a1ec
This is probably seperate enough to what you're working on that I could try and do a PR for this today, it doesn't seem that hard |
I just made an attempt at this and I don't think it's a good idea. The problem is, if we implement it, it'll only refresh the cache values if we hit a path that looks for one of these missing files, if we don't, the invalid cache will happily live on. I think #924 is actually the correct solution. If we have a file watcher we can cheaply (I think) check the validity of the cache (by looking for events in the watcher) every time we use values from it and if it isn't valid we can trigger a refresh. I'm not going to fix this and will close if you agree @glukos @JerryShea ? |
(i.e. maybe we can call |
I'm ok with closing this. In my understanding, #924 is mostly about performance. It will save us from unnecessary refreshes, but it will not fix a data race - obviously, WatchService doesn't priovide any guarantees on how fast events will arrive. Some more spit-balling - that's how tailers should find out that a new cycle is created:
Firstly, we write header to a mmapped memory, then we increment shared counter.
and find updated getMaxCreatedCycle(), but |
In
StoreTailer.toEnd
, we get thelastCycle
which is only checked against the file listing every 60s. In the event we've gotlastCycle
then failed to retrieve it from theSingleChronicleQueueStore
is it worth forcing adirectoryListing.refresh(true)
and retrying before throwing an exception?The text was updated successfully, but these errors were encountered: