Skip to content

Commit 7b6b050

Browse files
authored
Merge pull request #335 from ashish8678/develop
Handled case to clear tracker where event is not added to the LinkedBlockingQueue if its full.
2 parents 174fcbd + 3223c55 commit 7b6b050

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/com/splunk/hecclient/ConcurrentHec.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ public ConcurrentHec(int numberOfThreads, boolean useAck, HecConfig config, Poll
5757
@Override
5858
public final void send(final EventBatch batch) {
5959
try {
60-
batches.offer(batch, 1000, TimeUnit.MILLISECONDS);
60+
boolean offerSuccess = batches.offer(batch, 1000, TimeUnit.MILLISECONDS);
61+
if (!offerSuccess) {
62+
log.warn("Linked blocking queue is full (size = {}) for event batch = {}, failed to offer batch into queue", batches.size(), batch.getUUID());
63+
throw new HecException("linked blocking event queue is full, failed to offer batch into queue");
64+
}
6165
} catch (InterruptedException ex) {
6266
throw new HecException("failed to offer batch into queue", ex);
6367
}

0 commit comments

Comments
 (0)