Skip to content

Commit bd55834

Browse files
committed
Removing the redundant check
1 parent a01315d commit bd55834

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/http/conn/ReplayDispatcher.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
public class ReplayDispatcher {
4646
private static final Log log = LogFactory.getLog(ReplayDispatcher.class);
4747
private static volatile ReplayDispatcher instance;
48-
private volatile boolean running = true;
4948
// Counter tracking the number of dropped replay records due to queue overflow
5049
private final AtomicLong droppedCount = new AtomicLong(0);
5150
// Writer instance that handles actual replay data persistence
@@ -175,7 +174,7 @@ public void addReplayRecord(ByteBuffer dataBuffer, int byteWritten, String messa
175174
/**
176175
* Starts the background thread pool which asynchronously writes buffered replay records using
177176
* the configured ReplayDataWriter.
178-
* The worker threads run until running is set to false and the queue is drained.
177+
* The worker threads run until the queue is drained.
179178
*/
180179
private void startReplayWorker() {
181180
// ExecutorService managing a configurable pool of worker threads for asynchronously processing replay records
@@ -193,7 +192,7 @@ public Thread newThread(Runnable r) {
193192

194193
for (int i = 0; i < ReplayDispatcher.CORE_POOL_SIZE; i++) {
195194
replayWorkerThreadPool.submit(() -> {
196-
while (running || !replayQueue.isEmpty()) {
195+
while (!replayQueue.isEmpty()) {
197196
ReplayRecord replayRecord = replayQueue.poll();
198197
if (replayRecord != null) {
199198
try {

0 commit comments

Comments
 (0)