diff --git a/CHANGES.md b/CHANGES.md index 8ed63a674..418b7918b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,9 +4,9 @@ Release Notes. 8.12.0 ------------------ -* Fix `Shenyu plugin`'s NPE in reading read trace ID when IgnoredTracerContext is used in the context. +* Fix `Shenyu plugin`'s NPE in reading trace ID when IgnoredTracerContext is used in the context. * Update witness class in elasticsearch-6.x-plugin, avoid throw NPE. -* Fix `onHalfClose` using span operation name `/Request/onComplete` instead of the worng name `/Request/onHalfClose`. +* Fix `onHalfClose` using span operation name `/Request/onComplete` instead of the wrong name `/Request/onHalfClose`. * Add plugin to support RESTeasy 4.x. * Add plugin to support hutool-http 5.x. * Add plugin to support Tomcat 10.x. @@ -14,6 +14,7 @@ Release Notes. * Upgrade byte-buddy to 1.12.13, and adopt byte-buddy APIs changes. * Upgrade gson to 2.8.9. * Upgrade netty-codec-http2 to 4.1.79.Final. +* Fix race condition causing agent to not reconnect after network error #### Documentation diff --git a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/remote/GRPCChannelManager.java b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/remote/GRPCChannelManager.java index 2d2308809..9744398fd 100755 --- a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/remote/GRPCChannelManager.java +++ b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/remote/GRPCChannelManager.java @@ -146,16 +146,16 @@ public class GRPCChannelManager implements BootService, Runnable { .addChannelDecorator(new AgentIDDecorator()) .addChannelDecorator(new AuthenticationDecorator()) .build(); - notify(GRPCChannelStatus.CONNECTED); reconnectCount = 0; reconnect = false; + notify(GRPCChannelStatus.CONNECTED); } else if (managedChannel.isConnected(++reconnectCount > Config.Agent.FORCE_RECONNECTION_PERIOD)) { // Reconnect to the same server is automatically done by GRPC, // therefore we are responsible to check the connectivity and // set the state and notify listeners reconnectCount = 0; - notify(GRPCChannelStatus.CONNECTED); reconnect = false; + notify(GRPCChannelStatus.CONNECTED); } return;