When first and last cycle are out of date, should we try refreshing them and retrying before we throw?
See original GitHub issueIn StoreTailer.toEnd, we get the lastCycle which is only checked against the file listing every 60s. In the event we’ve got lastCycle then failed to retrieve it from the SingleChronicleQueueStore is it worth forcing a directoryListing.refresh(true) and retrying before throwing an exception?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Xcode 13.1 will gets "stuck" on iOS Monterey/ New 2021 pro
I have a 2016 MacBook Pro and a 2014 Mac mini that have been downloading and "installing" Xcode now for 3 days. They...
Read more >Axios Interceptors retry original request and access original ...
when the token is successfully refreshed, I retry the AXIOS request using an updated config - including the new fresh token and setting...
Read more >Retrying event-driven functions - Google Cloud
When you enable retries on an event-driven function, Cloud Functions will retry a failed function invocation until it completes successfully or the retry ......
Read more >How a RESTful API server reacts to requests - O'Reilly
Learn how to properly design RESTful APIs communication with clients, accounting for request structure, authentication, and caching.
Read more >Working with Amazon SQS messages - AWS Documentation
Processing messages in a timely manner. Setting the visibility timeout depends on how long it takes your application to process and delete a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I think the scenario we saw was in
optimizedToEnd, where anIllegalStateExceptionis thrownhttps://github.com/OpenHFT/Chronicle-Queue/blob/db7a1ecb65fa6b7a97f8c6b01f7ff2da3ef3b0b7/src/main/java/net/openhft/chronicle/queue/impl/single/StoreTailer.java#L887-L891
It’s also repeated in
approximateLastCycle2: https://github.com/OpenHFT/Chronicle-Queue/blob/db7a1ecb65fa6b7a97f8c6b01f7ff2da3ef3b0b7/src/main/java/net/openhft/chronicle/queue/impl/single/StoreTailer.java#L748-L752 but that seems to be retried already https://github.com/OpenHFT/Chronicle-Queue/blob/db7a1ecb65fa6b7a97f8c6b01f7ff2da3ef3b0b7/src/main/java/net/openhft/chronicle/queue/impl/single/StoreTailer.java#L768-L775This 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’m ok with closing this.
In my understanding, https://github.com/OpenHFT/Chronicle-Queue/issues/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. As I see it, the initial purpose of refresh was dealing with manual manipulations with queue dir. Ideally, we shouldn’t rely on the refresh to resolve data races that happen in normal workflow.
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. Tailer in another thread / process may go here:
and find updated getMaxCreatedCycle(), but
!path.exists()way be true as per file creation hasn’t been synced by OS yet. Should we consider spinning for a while here before returning null?