Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gRPC服务未正常关闭 #1153

Open
honeyshine75 opened this issue Dec 19, 2024 · 0 comments
Open

gRPC服务未正常关闭 #1153

honeyshine75 opened this issue Dec 19, 2024 · 0 comments
Labels
bug Something does not work as expected

Comments

@honeyshine75
Copy link

gRPC端口在线程终止时未及时释放
发现过程

  1. 服务启动正常工作
  2. 服务更新后进行滚动部署,使用svc -d关闭线程
  3. 线程已经关闭,但是可以观察到GrpcServerLifecycle中的stop未触发(在listener中的打点未触发)
  4. 新jar包开始启动,提示“Address already in use”

缓解
是否可以通过Runtime.getRuntime().addShutdownHook() 来注册一个关闭钩子,来缓解这种情况

The application's environment

Which versions do you use?

  • Spring (boot): 2.1.9
  • grpc-java: 1.65.0
  • grpc-spring-boot-starter: 2.15.0
  • java: version + architecture (64bit?) 8

Additional context

  • Did it ever work before?
  • Do you have a demo?
@honeyshine75 honeyshine75 added the bug Something does not work as expected label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something does not work as expected
Projects
None yet
Development

No branches or pull requests

1 participant