Skip to content

Commit

Permalink
ISPN-15298 Add block hound exception for index submitToQueue
Browse files Browse the repository at this point in the history
  • Loading branch information
fax4ever authored and wburns committed Nov 7, 2023
1 parent fff0d0e commit 9261974
Showing 1 changed file with 9 additions and 0 deletions.
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");
}
}

0 comments on commit 9261974

Please sign in to comment.