You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by se...@apache.org on 2017/12/29 09:18:22 UTC

[incubator-servicecomb-saga] 05/05: SCB-138 add logs for the interruption of grpc server

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

seanyinx pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git

commit 2adebc4403975a28c76cb7086baa76457f0e2d7e
Author: Eric Lee <da...@huawei.com>
AuthorDate: Fri Dec 29 16:46:29 2017 +0800

    SCB-138 add logs for the interruption of grpc server
    
    Signed-off-by: Eric Lee <da...@huawei.com>
---
 .../main/java/io/servicecomb/saga/alpha/server/GrpcStartable.java   | 6 ++++++
 pom.xml                                                             | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/alpha/alpha-server/src/main/java/io/servicecomb/saga/alpha/server/GrpcStartable.java b/alpha/alpha-server/src/main/java/io/servicecomb/saga/alpha/server/GrpcStartable.java
index 6affb62..663de71 100644
--- a/alpha/alpha-server/src/main/java/io/servicecomb/saga/alpha/server/GrpcStartable.java
+++ b/alpha/alpha-server/src/main/java/io/servicecomb/saga/alpha/server/GrpcStartable.java
@@ -21,14 +21,19 @@
 package io.servicecomb.saga.alpha.server;
 
 import java.io.IOException;
+import java.lang.invoke.MethodHandles;
 import java.util.Arrays;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import io.grpc.BindableService;
 import io.grpc.Server;
 import io.grpc.ServerBuilder;
 
 class GrpcStartable implements ServerStartable {
 
+  private static Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
   private final Server server;
 
   GrpcStartable(int port, BindableService... services) {
@@ -47,6 +52,7 @@ class GrpcStartable implements ServerStartable {
     } catch (IOException e) {
       throw new IllegalStateException("Unable to start grpc server.", e);
     } catch (InterruptedException e) {
+      LOG.error("grpc server was interrupted.", e);
       Thread.currentThread().interrupt();
     }
   }
diff --git a/pom.xml b/pom.xml
index 8c4e15a..45cb12c 100755
--- a/pom.xml
+++ b/pom.xml
@@ -519,7 +519,7 @@
           <configuration>
             <protocArtifact>com.google.protobuf:protoc:3.5.0:exe:${os.detected.classifier}</protocArtifact>
             <pluginId>grpc-java</pluginId>
-            <pluginArtifact>io.grpc:protoc-gen-grpc-java:1.8.0:exe:${os.detected.classifier}</pluginArtifact>
+            <pluginArtifact>io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier}</pluginArtifact>
           </configuration>
           <executions>
             <execution>

-- 
To stop receiving notification emails like this one, please contact
"commits@servicecomb.apache.org" <co...@servicecomb.apache.org>.