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

Remove shutdown latch from BftProcessor #3478

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import org.hyperledger.besu.consensus.common.bft.events.BftEvent;

import java.util.Optional;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

import org.slf4j.Logger;
Expand All @@ -31,7 +30,6 @@ public class BftProcessor implements Runnable {
private final BftEventQueue incomingQueue;
private volatile boolean shutdown = false;
private final EventMultiplexer eventMultiplexer;
private final CountDownLatch shutdownLatch = new CountDownLatch(1);

/**
* Construct a new BftProcessor
Expand All @@ -49,10 +47,6 @@ public void stop() {
shutdown = true;
}

public void awaitStop() throws InterruptedException {
shutdownLatch.await();
}

@Override
public void run() {
try {
Expand All @@ -64,7 +58,6 @@ public void run() {
}
// Clean up the executor service the round timer has been utilising
LOG.info("Shutting down BFT event processor");
shutdownLatch.countDown();
}

private Optional<BftEvent> nextEvent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,6 @@ public void stop() {
if (state.compareAndSet(State.RUNNING, State.STOPPED)) {
blockchain.removeObserver(blockAddedObserverId);
bftProcessor.stop();
// Make sure the processor has stopped before shutting down the executors
try {
bftProcessor.awaitStop();
} catch (final InterruptedException e) {
LOG.debug("Interrupted while waiting for IbftProcessor to stop.", e);
Thread.currentThread().interrupt();
}
bftExecutors.stop();
}
}
Expand Down