diff --git a/src/main/java/io/orkes/conductor/client/grpc/PooledPoller.java b/src/main/java/io/orkes/conductor/client/grpc/PooledPoller.java index f02e89cc..01786156 100644 --- a/src/main/java/io/orkes/conductor/client/grpc/PooledPoller.java +++ b/src/main/java/io/orkes/conductor/client/grpc/PooledPoller.java @@ -236,10 +236,12 @@ public void onCompleted() { private void drain() { long didntGetMessageCount = lastAskedForMessageCount.get(); - log.info("Didn't get {} messages", didntGetMessageCount); - for (int i = 0; i < didntGetMessageCount; i++) { - this.saveTask(TaskPb.Task.newBuilder().setTaskId("NO_OP").build()); - semaphore.release(); + if(didntGetMessageCount > 0) { + log.info("Didn't get {} messages from server as expected", didntGetMessageCount); + for (int i = 0; i < didntGetMessageCount; i++) { + this.saveTask(TaskPb.Task.newBuilder().setTaskId("NO_OP").build()); + semaphore.release(); + } } callAgain.set(true); }