]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/pubsub: prevent kafka thread from spinning when there are no 31998/head
authorYuval Lifshitz <yuvalif@yahoo.com>
Tue, 3 Dec 2019 18:16:25 +0000 (20:16 +0200)
committerYuval Lifshitz <yuvalif@yahoo.com>
Tue, 3 Dec 2019 18:16:25 +0000 (20:16 +0200)
messages

Signed-off-by: Yuval Lifshitz <yuvalif@yahoo.com>
src/rgw/rgw_kafka.cc
src/test/rgw/rgw_multi/tests_ps.py

index b1b97493305676cac4d039fdc4b821b5eba0d5ad..4f7751ae6c6b3906d3870a66122fd0182700fff2 100644 (file)
@@ -372,9 +372,9 @@ private:
     while (!stopped) {
 
       // publish all messages in the queue
-      auto event_count = 0U;
-      const auto count = messages.consume_all(std::bind(&Manager::publish_internal, this, std::placeholders::_1));
-      dequeued += count;
+      auto reply_count = 0U;
+      const auto send_count = messages.consume_all(std::bind(&Manager::publish_internal, this, std::placeholders::_1));
+      dequeued += send_count;
       ConnectionList::iterator conn_it;
       ConnectionList::const_iterator end_it;
       {
@@ -412,14 +412,14 @@ private:
           INCREMENT_AND_CONTINUE(conn_it);
         }
 
-        event_count += rd_kafka_poll(conn->producer, read_timeout_ms);
+        reply_count += rd_kafka_poll(conn->producer, read_timeout_ms);
 
         // just increment the iterator
         ++conn_it;
       }
       // if no messages were received or published
       // across all connection, sleep for 100ms
-      if (count == 0 && event_count) {
+      if (send_count == 0 && reply_count == 0) {
         std::this_thread::sleep_for(std::chrono::milliseconds(100));
       }
     }
index ebac97d3dce047000fa1b359975ab99701fc60e2..f490809a5d18d31eaf21cfbcf8d8dfeb5bb2107e 100644 (file)
@@ -28,7 +28,7 @@ from nose.tools import assert_not_equal, assert_equal
 # configure logging for the tests module
 log = logging.getLogger(__name__)
 
-skip_push_tests = False
+skip_push_tests = True
 
 ####################################
 # utility functions for pubsub tests