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 2020/05/27 07:04:31 UTC

[GitHub] [servicecomb-pack] fengmingming opened a new issue #663: 调用@Compensable注解方法前没有调用@SagaStart注解的方法,会报nullpointsexception,导致连接不可用。

fengmingming opened a new issue #663:
URL: https://github.com/apache/servicecomb-pack/issues/663


   如果在调用@Compensable注解方法前没有调用@SagaStart注解的方法,会报nullpointsexception。这种情况下会执行一下代码
    LOG.error("Retry sending event {} due to failure", event, e);
    loadContext.getSenders().put(messageSender, Long.MAX_VALUE);
   导致 messageSender 不可用。再次请求就会报all alpha server is down。
   我看代码中有重连的逻辑,但不知道如何让重连逻辑起作用?
   如果能把异常包装成omegaexception,就可用避免这个问题。问题代码如下
   LoadBalanceSenderAdapter.java
   AlphaResponse response = null;
       try {
         long startTime = System.nanoTime();
         response = executor.apply(event);
         loadContext.getSenders().put(messageSender, System.nanoTime() - startTime);
       } catch (OmegaException e) {
         throw e;
       } catch (Exception e) {
         LOG.error("Retry sending event {} due to failure", event, e);
         loadContext.getSenders().put(messageSender, Long.MAX_VALUE);//设置MAX_VALUE 导致messageSender不可用。
       }
       return Optional.fromNullable(response);
   


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



[GitHub] [servicecomb-pack] fengmingming commented on issue #663: 调用@Compensable注解方法前没有调用@SagaStart注解的方法,会报nullpointsexception,导致连接不可用。

Posted by GitBox <gi...@apache.org>.
fengmingming commented on issue #663:
URL: https://github.com/apache/servicecomb-pack/issues/663#issuecomment-634487403


   > 
   > 
   > 这种情况应该会提示 Cannot find the globalTxId from OmegaContext 错误吧
   > 
   > https://github.com/apache/servicecomb-pack/blob/b476b8b7b98e3feafacfb26beafd78523176b83a/omega/omega-transaction/src/main/java/org/apache/servicecomb/pack/omega/transaction/TransactionAspect.java#L60
   
   看到在0.6.0中已经提示 Cannot find the globalTxId from OmegaContext 


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



[GitHub] [servicecomb-pack] coolbeevip commented on issue #663: 调用@Compensable注解方法前没有调用@SagaStart注解的方法,会报nullpointsexception,导致连接不可用。

Posted by GitBox <gi...@apache.org>.
coolbeevip commented on issue #663:
URL: https://github.com/apache/servicecomb-pack/issues/663#issuecomment-634475633


   这种情况应该会提示 Cannot find the globalTxId from OmegaContext 错误吧
   
   https://github.com/apache/servicecomb-pack/blob/b476b8b7b98e3feafacfb26beafd78523176b83a/omega/omega-transaction/src/main/java/org/apache/servicecomb/pack/omega/transaction/TransactionAspect.java#L60


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



[GitHub] [servicecomb-pack] fengmingming closed issue #663: 调用@Compensable注解方法前没有调用@SagaStart注解的方法,会报nullpointsexception,导致连接不可用。

Posted by GitBox <gi...@apache.org>.
fengmingming closed issue #663:
URL: https://github.com/apache/servicecomb-pack/issues/663


   


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