On a MirroredIndex, when setting the offline fallback timeout using MirroredIndex.setOfflineFallbackTimeout(long, TimeUnit), the conversion between the specified time unit and milliseconds is erroneous, resulting in the wrong timeout being applied.
Expected behavior
The TimeUnit.convert method works the other way round.
Proposed solution
Just switch the direction of conversion! ;)
I quickly reviewed other call to TimeUnit.convert in the same file (here and here) and they seem correct, but probably a scan of the full codebase would be required to hunt down any other occurrences of this bug.
References
(Algolia internal) Ticket 68546; please notify customer when fixed
Current behavior
On a
MirroredIndex
, when setting the offline fallback timeout usingMirroredIndex.setOfflineFallbackTimeout(long, TimeUnit)
, the conversion between the specified time unit and milliseconds is erroneous, resulting in the wrong timeout being applied.Expected behavior
The
TimeUnit.convert
method works the other way round.Proposed solution
Just switch the direction of conversion! ;)
I quickly reviewed other call to
TimeUnit.convert
in the same file (here and here) and they seem correct, but probably a scan of the full codebase would be required to hunt down any other occurrences of this bug.References