wu-sheng commented on code in PR #777:
URL: https://github.com/apache/skywalking-java/pull/777#discussion_r2516420514


##########
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/remote/GRPCChannelManager.java:
##########
@@ -184,21 +184,65 @@ public Channel getChannel() {
      */
     public void reportError(Throwable throwable) {
         if (isNetworkError(throwable)) {
-            reconnect = true;
-            notify(GRPCChannelStatus.DISCONNECT);
+            triggerReconnect();
         }
     }
 
     private void notify(GRPCChannelStatus status) {
-        for (GRPCChannelListener listener : listeners) {
-            try {
-                listener.statusChanged(status);
-            } catch (Throwable t) {
-                LOGGER.error(t, "Fail to notify {} about channel connected.", 
listener.getClass().getName());
+        synchronized (listeners) {

Review Comment:
   Why lock this? I can't see anyone changed this list.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to