commit | fd984b01b6ecc94cfab62b9791521f5bfa0c28a4 | [log] [tgz] |
---|---|---|
author | Chao Shi <stepinto@live.com> | Mon Nov 11 11:23:08 2013 +0800 |
committer | Chao Shi <stepinto@live.com> | Mon Nov 11 11:23:08 2013 +0800 |
tree | eb9dbda4e3f5606663bdf96f573fc5ed42a8b0b8 | |
parent | 64f4b3e8381a5e65eed28390199aa4f2281d5870 [diff] |
Fix CPU high problem when the zipkin collector is down
diff --git a/htrace-zipkin/src/main/java/org/cloudera/htrace/impl/ZipkinSpanReceiver.java b/htrace-zipkin/src/main/java/org/cloudera/htrace/impl/ZipkinSpanReceiver.java index 110ffbb..f92491b 100644 --- a/htrace-zipkin/src/main/java/org/cloudera/htrace/impl/ZipkinSpanReceiver.java +++ b/htrace-zipkin/src/main/java/org/cloudera/htrace/impl/ZipkinSpanReceiver.java
@@ -278,7 +278,11 @@ errorCount += 1; // If there have been ten errors in a row start dropping things. if (errorCount < MAX_ERRORS) { - dequeuedSpans.addAll(dequeuedSpans); + try { + queue.addAll(dequeuedSpans); + } catch (IllegalStateException ex) { + // Just drop them if queue is full. + } } closeClient();