Skip to content

Commit

Permalink
reenable plainactionfuture assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
ywangd committed Oct 9, 2024
1 parent 3b37f43 commit c6d7524
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import org.elasticsearch.common.util.concurrent.UncategorizedExecutionException;
import org.elasticsearch.core.Nullable;
import org.elasticsearch.core.TimeValue;
import org.elasticsearch.logging.LogManager;
import org.elasticsearch.logging.Logger;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.Transports;

Expand All @@ -31,6 +33,7 @@
import java.util.concurrent.locks.AbstractQueuedSynchronizer;

public class PlainActionFuture<T> implements ActionFuture<T>, ActionListener<T> {
private static final Logger logger = LogManager.getLogger(PlainActionFuture.class);

@Override
public void onResponse(@Nullable T result) {
Expand All @@ -39,7 +42,12 @@ public void onResponse(@Nullable T result) {

@Override
public void onFailure(Exception e) {
// assert assertCompleteAllowed();
try {
assert assertCompleteAllowed();
} catch (AssertionError ae) {
logger.info("--> AssertionError while onFailure", e);
throw ae;
}
if (sync.setException(Objects.requireNonNull(e))) {
done(false);
}
Expand Down

0 comments on commit c6d7524

Please sign in to comment.