You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by "Jack-Jiang (via GitHub)" <gi...@apache.org> on 2024/08/28 02:16:57 UTC

[I] 优雅停止调用RegistryUtils#destroy后,内存任务无法外出 [servicecomb-java-chassis]

Jack-Jiang opened a new issue, #4475:
URL: https://github.com/apache/servicecomb-java-chassis/issues/4475

   这个导致优雅停的时候,shutdownhook时,无法外出,内存中的任务无法外出rpc导致呼损
   优雅停期间应该是关闭入口,但是需要处理完成已经在内存中的任务,这些任务也有调用其他接口的诉求。
   之前是优雅是没问题的按照这种设计思想。 现在看代码是不兼容的修改导致:
   ![image](https://github.com/user-attachments/assets/7b68e600-e892-487d-8cea-099745d31e77)
   
   优雅期间接口调用报错:
   error: java.lang.NullPointerException[N][N]	at org.apache.servicecomb.serviceregistry.RegistryUtils.getMicroservice(RegistryUtils.java:166)[N][N]	at org.apache.servicecomb.serviceregistry.ServiceCenterRegistration.getMicroservice(ServiceCenterRegistration.java:67)[N][N]	at org.apache.servicecomb.registry.RegistrationManager.getMicroservice(RegistrationManager.java:99)[N][N]	at org.apache.servicecomb.core.invocation.InvocationFactory.setSrcMicroservice(InvocationFactory.java:48)[N][N]	at org.apache.servicecomb.provider.pojo.PojoInvocation.<init>(PojoInvocation.java:34)[N][N]	at org.apache.servicecomb.provider.pojo.PojoInvocationCreator.create(PojoInvocationCreator.java:29)[N][N]	at org.apache.servicecomb.provider.pojo.HandlerInvocationCaller.call(HandlerInvocationCaller.java:31)[N][N]	at 


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

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] 优雅停止调用RegistryUtils#destroy后,内存任务无法外出 [servicecomb-java-chassis]

Posted by "Jack-Jiang (via GitHub)" <gi...@apache.org>.
Jack-Jiang closed issue #4475: 优雅停止调用RegistryUtils#destroy后,内存任务无法外出
URL: https://github.com/apache/servicecomb-java-chassis/issues/4475


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

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] 优雅停止调用RegistryUtils#destroy后,内存任务无法外出 [servicecomb-java-chassis]

Posted by "Jack-Jiang (via GitHub)" <gi...@apache.org>.
Jack-Jiang commented on issue #4475:
URL: https://github.com/apache/servicecomb-java-chassis/issues/4475#issuecomment-2317013430

   就是我们在k8s的preStop时调用org.apache.servicecomb.serviceregistry.RegistryUtils#destroy来关闭rpc入口流量;以及其他流量入口如kafka等异步流量。
   但是内存中有关闭流量前已经收到的请求正在异步执行,如kafka内存已经消费的队列中的任务,这些任务进行rpc调用时报错如上截图的。
   实际我们只需要ServiceRegistry::destroy封堵入口流量。


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

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] 优雅停止调用RegistryUtils#destroy后,内存任务无法外出 [servicecomb-java-chassis]

Posted by "liubao68 (via GitHub)" <gi...@apache.org>.
liubao68 commented on issue #4475:
URL: https://github.com/apache/servicecomb-java-chassis/issues/4475#issuecomment-2316521837

   系统正在停止开始清理资源的时候,并不能保证所有场景新发起的请求能够成功。 你能提供下信息,这个异常触发的方式吗?比如是内部定时任务触发的RPC调用,还是正在服务器收到请求,执行的逻辑中包含的RPC调用。 


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

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] 优雅停止调用RegistryUtils#destroy后,内存任务无法外出 [servicecomb-java-chassis]

Posted by "Jack-Jiang (via GitHub)" <gi...@apache.org>.
Jack-Jiang commented on issue #4475:
URL: https://github.com/apache/servicecomb-java-chassis/issues/4475#issuecomment-2320618638

   ok.我们修改下调用方式,应该是可以的。
   只是RegistryUtils#destroy这个public方法相当于改的有点不兼容


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

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] 优雅停止调用RegistryUtils#destroy后,内存任务无法外出 [servicecomb-java-chassis]

Posted by "liubao68 (via GitHub)" <gi...@apache.org>.
liubao68 commented on issue #4475:
URL: https://github.com/apache/servicecomb-java-chassis/issues/4475#issuecomment-2317532928

   从设计上来讲,你描述的场景不应该调用 RegistryUtils#destroy, 我理解应该是可以考虑将服务的状态由 UP 改为 Down。 销毁注册组件,自然无法保证客户端调用总是成功。 
   
   你描述的场景使用
   
   ```
    RegistrationManager.INSTANCE.updateMicroserviceInstanceStatus(MicroserviceInstanceStatus.DOWN)
   ```
   应该是更加合适的。 


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

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org