-
Notifications
You must be signed in to change notification settings - Fork 612
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ISPN-15298 Add block hound exception for index submitToQueue
- Loading branch information
Showing
1 changed file
with
9 additions
and
0 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
query/src/main/java/org/infinispan/query/internal/QueryBlockHoundIntegration.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,25 @@ | ||
package org.infinispan.query.internal; | ||
|
||
import org.apache.lucene.util.NamedSPILoader; | ||
import org.hibernate.search.engine.backend.work.execution.OperationSubmitter; | ||
import org.kohsuke.MetaInfServices; | ||
|
||
import reactor.blockhound.BlockHound; | ||
import reactor.blockhound.integration.BlockHoundIntegration; | ||
|
||
@MetaInfServices | ||
public class QueryBlockHoundIntegration implements BlockHoundIntegration { | ||
|
||
@Override | ||
public void applyTo(BlockHound.Builder builder) { | ||
// Loading a service may require opening a file from classpath | ||
builder.allowBlockingCallsInside(NamedSPILoader.class.getName(), "reload"); | ||
|
||
// With Infinispan the implementation is OffloadingExecutorOperationSubmitter. | ||
// Here the submitToQueue method invokes BlockingQueue#offer, the single argument one, | ||
// that uses the lock of the blocking queue just to check safely the size of the data structure, | ||
// releasing immediately the lock after this super-short check. | ||
builder.allowBlockingCallsInside(OperationSubmitter.class.getName() + "$OffloadingExecutorOperationSubmitter", | ||
"submitToQueue"); | ||
} | ||
} |