You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2019/10/07 09:31:47 UTC
[GitHub] [servicecomb-java-chassis] liubao68 commented on a change in pull
request #1334: [SCB-1494] Optimizing log when starting a new microservice
liubao68 commented on a change in pull request #1334: [SCB-1494] Optimizing log when starting a new microservice
URL: https://github.com/apache/servicecomb-java-chassis/pull/1334#discussion_r331924060
##########
File path: service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/ServiceRegistryClientImpl.java
##########
@@ -142,6 +143,23 @@ private void retry(RequestContext requestContext, Handler<RestResponse> response
return;
}
+ // no need to generate warn log when schema or service not exist
+ if (HttpStatusClass.CLIENT_ERROR.equals(HttpStatusClass.valueOf(response.statusCode()))) {
+ try {
+ @SuppressWarnings("unchecked")
+ String errorCode = JsonUtils.readValue(bodyBuffer.getBytes(), Map.class).get("errorCode").toString();
+ // 400012: ErrServiceNotExists
+ // 400016: ErrSchemaNotExists
+ if (errorCode.equals("400012") || errorCode.equals("400016")) {
+ countDownLatch.countDown();
+ return;
+ }
+ } catch (IOException | NullPointerException ignored) {
+ // Ignore IOException when read value from bodyBuffergit
+ // Ignore NullPointerException when bodyBuffer not contains errorCode
Review comment:
Does this mean these two exception will never happen? I don't think it's not a good idea to ingore them when the exception will throw.
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services