Skip to content
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

ISPN-10975 Transactional cache will slow down the expiration reaper #7610

Merged

Conversation

wburns
Copy link
Member

@wburns wburns commented Nov 22, 2019

@wburns wburns added the On Hold label Nov 22, 2019
CompletableFuture<Void> future;
if (transactional) {
// Transactional is still blocking - to be removed later
future = CompletableFuture.supplyAsync(() -> cacheToUse.removeLifespanExpired(key, value, lifespan), asyncExecutor)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a NullPointer with this fix if the reaper is executed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be fixed now; added the missing @Inject

@wburns wburns force-pushed the expiration_non_blocking_transaction branch from c965ec9 to 916ad8c Compare December 2, 2019 15:43
@wburns wburns added Backport and removed On Hold labels Dec 6, 2019
@wburns wburns force-pushed the expiration_non_blocking_transaction branch from 916ad8c to 362593b Compare December 6, 2019 18:05
@wburns wburns changed the title Expiration Reaper defer to async thread pool when in a transaction ISPN-10975 Transactional cache will slow down the expiration reaper Dec 6, 2019
CompletableFuture<Void> future = cacheToUse.removeLifespanExpired(key, value, lifespan);
CompletableFuture<Void> future;
if (transactional) {
// Transactional is still blocking - to be removed later
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO we could make cache.removeLifespanExpired() submit a task to an executor internally when it's not part of a transaction, but the only way to make it realy non-blocking is to avoid any interaction with JTA, at which point we might as well remove it from the AdvancedCache API.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think we may have to remove it from the API to more cleanly fix this in the future. This is mostly just a stop gap until that can be done.

@tristantarrant tristantarrant merged commit 7b68f09 into infinispan:9.4.x Dec 9, 2019
@tristantarrant
Copy link
Member

Merged, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants