You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2018/08/28 15:36:38 UTC

[GitHub] QiuMM commented on a change in pull request #6254: fix opentsdb emitter occupy 100%(#6247)

QiuMM commented on a change in pull request #6254: fix opentsdb emitter occupy 100%(#6247)
URL: https://github.com/apache/incubator-druid/pull/6254#discussion_r213365894
 
 

 ##########
 File path: extensions-contrib/opentsdb-emitter/src/main/java/io/druid/emitter/opentsdb/OpentsdbSender.java
 ##########
 @@ -110,12 +119,15 @@ private void sendEvents()
     public void run()
     {
       while (running) {
-        if (!eventQueue.isEmpty()) {
-          OpentsdbEvent event = eventQueue.poll();
+        try {
+          OpentsdbEvent event = eventQueue.take();
           events.add(event);
-          if (events.size() >= flushThreshold) {
-            sendEvents();
-          }
+        }
+        catch (InterruptedException e) {
+          log.error(e, "consumer take event failed!");
+        }
+        if (events.size() >= flushThreshold) {
+          sendEvents();
 
 Review comment:
   The while loop still always be running! Problem have not been solved. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org