wu-sheng commented on a change in pull request #3170: Support upgrade backend 
w/o rebooting agents
URL: https://github.com/apache/skywalking/pull/3170#discussion_r308041887
 
 

 ##########
 File path: 
oap-server/server-receiver-plugin/skywalking-register-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/register/provider/handler/v6/grpc/ServiceInstancePingServiceHandler.java
 ##########
 @@ -57,11 +61,21 @@ public ServiceInstancePingServiceHandler(ModuleManager 
moduleManager) {
         ServiceInstanceInventory serviceInstanceInventory = 
serviceInstanceInventoryCache.get(serviceInstanceId);
         if (Objects.nonNull(serviceInstanceInventory)) {
             
serviceInventoryRegister.heartbeat(serviceInstanceInventory.getServiceId(), 
heartBeatTime);
+            responseObserver.onNext(Commands.getDefaultInstance());
         } else {
-            logger.warn("Can't found service by service instance id from 
cache, service instance id is: {}", serviceInstanceId);
+            logger.warn("Can't found service by service instance id from 
cache," +
+                " service instance id is: {}, will send a reset command to 
agent side", serviceInstanceId);
+            final String serialNumber = generateSerialNumber(request);
+            final Command resetCommand = new 
ServiceResetCommand(serialNumber).serialize().build();
+            final Commands nextCommands = 
Commands.newBuilder().addCommands(resetCommand).build();
 
 Review comment:
   Command should be generated in the server-core module, please add a new 
service there in `org.apache.skywalking.oap.server.core.command`.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to