You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2019/03/08 08:49:07 UTC

[incubator-skywalking] branch bug-fix created (now 4c7082c)

This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a change to branch bug-fix
in repository https://gitbox.apache.org/repos/asf/incubator-skywalking.git.


      at 4c7082c  Envoy heartbeat update bug

This branch includes the following new commits:

     new 4c7082c  Envoy heartbeat update bug

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[incubator-skywalking] 01/01: Envoy heartbeat update bug

Posted by wu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch bug-fix
in repository https://gitbox.apache.org/repos/asf/incubator-skywalking.git

commit 4c7082c0850992a99626aaace01e0c5d3c5f36f6
Author: Wu Sheng <wu...@foxmail.com>
AuthorDate: Fri Mar 8 16:48:53 2019 +0800

    Envoy heartbeat update bug
---
 .../oap/server/receiver/envoy/MetricServiceGRPCHandler.java           | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/oap-server/server-receiver-plugin/envoy-metrics-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/envoy/MetricServiceGRPCHandler.java b/oap-server/server-receiver-plugin/envoy-metrics-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/envoy/MetricServiceGRPCHandler.java
index 5ccaa88..9f9c82e 100644
--- a/oap-server/server-receiver-plugin/envoy-metrics-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/envoy/MetricServiceGRPCHandler.java
+++ b/oap-server/server-receiver-plugin/envoy-metrics-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/envoy/MetricServiceGRPCHandler.java
@@ -96,6 +96,7 @@ public class MetricServiceGRPCHandler extends MetricsServiceGrpc.MetricsServiceI
 
                 if (serviceInstanceId != Const.NONE) {
                     List<Metrics.MetricFamily> list = message.getEnvoyMetricsList();
+                    boolean needHeartbeatUpdate = true;
                     for (int i = 0; i < list.size(); i++) {
                         counter.inc();
                         HistogramMetric.Timer timer = histogram.createTimer();
@@ -123,10 +124,11 @@ public class MetricServiceGRPCHandler extends MetricsServiceGrpc.MetricsServiceI
                                 default:
                                     continue;
                             }
-                            if (i == 0) {
+                            if (needHeartbeatUpdate) {
                                 // Send heartbeat
                                 serviceInventoryRegister.heartbeat(serviceId, timestamp);
                                 serviceInstanceInventoryRegister.heartbeat(serviceInstanceId, timestamp);
+                                needHeartbeatUpdate = false;
                             }
                         } finally {
                             timer.finish();