dnrusakov commented on a change in pull request #3355: Add a cap to metrics 
communicator in TMasterSink and MetricsCacheSink
URL: https://github.com/apache/incubator-heron/pull/3355#discussion_r331263432
 
 

 ##########
 File path: 
heron/metricsmgr/src/java/org/apache/heron/metricsmgr/sink/metricscache/MetricsCacheClient.java
 ##########
 @@ -93,12 +93,20 @@ private void addMetricsCacheClientTasksOnWakeUp() {
     Runnable task = new Runnable() {
       @Override
       public void run() {
-        while (!publishMetricsCommunicator.isEmpty()) {
-          TopologyMaster.PublishMetrics publishMetrics = 
publishMetricsCommunicator.poll();
+        TopologyMaster.PublishMetrics publishMetrics;
+        synchronized (publishMetricsCommunicator) {
 
 Review comment:
   I see that previously we didn't use `synchronized` during operations on 
`publishMetricsCommunicator`.
   What have changed? Do we now work with `publishMetricsCommunicator` in 
different threads?

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


With regards,
Apache Git Services

Reply via email to