Skip to content

gRPC服务未正常关闭 #1153

Open
Open
@honeyshine75

Description

@honeyshine75

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething does not work as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions