-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix variable expiration with async cache (fixes #159)
An in-flight future was mistakenly given the maximum expiry allowed, causing it to not honor an expire-after-create setting. Instead it was supposed to be beyond the maximum to signal adaption on the completion update. The calculations for fixed expiration was made more robust to the time rolling over. This now complies with System.nanoTime() warnings. Strengthened the remove and replace operations to be more predictably linearizable. This removed optimizations to avoid unnecessary work by checking if the entry was present in a lock-free manner. Since the hash table supresses loads until complete, that might mean that a call to remove a loading entry was not performed. The contract allows either, so the optimization is left to user code and gives preference to those who need the linearizable behavior. (See #156)
- Loading branch information
Showing
8 changed files
with
365 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.