fix: reconnection race condition (#290)

This commit is contained in:
Brandon Fergerson 2022-08-08 18:42:11 +04:00 committed by GitHub
parent 840e381181
commit 3e71ae4cdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

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

View File

@ -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;