alibaba / alibaba-rsocket-broker

Alibaba RSocket Broker: Mesh, Streaming & IoT
https://alibroker.info
Apache License 2.0
761 stars 167 forks source link

服务在线约3分钟后,appNotificationProcessor 会发射离线信号? #241

Closed shareisall closed 1 year ago

shareisall commented 1 year ago

Describe the bug 服务在线约3分钟后,appNotificationProcessor 会发射离线信号,这是怎么回事?

Environment

Steps to reproduce this issue

  1. 在 broker 上创建 ApplicatgionRunner 并在 run 方法中订阅 appNotificationProcessor 将信号打印到控制台
  2. 启动 broker,并在 broker 启动完成后,任意启动一项服务应用(假设为 uid-service)
  3. uid-service 启动后,观察 broker 的控制台输出:
2023-10-31T09:38:30.764+08:00  INFO 24477 --- [           main] c.g.c.brokerserver.BrokerServerAppKt     : Starting BrokerServerAppKt using Java 17.0.8 with PID 24477 (/home/max/Documents/projects/spring/hy-cloud/broker/broker-server/build/classes/kotlin/main started by max in /home/max/Documents/projects/spring/hy-cloud)
2023-10-31T09:38:30.765+08:00  INFO 24477 --- [           main] c.g.c.brokerserver.BrokerServerAppKt     : No active profile set, falling back to 1 default profile: "default"
2023-10-31T09:38:31.441+08:00  INFO 24477 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'com.alibaba.spring.boot.rsocket.broker.RSocketBrokerAutoConfiguration' of type [com.alibaba.spring.boot.rsocket.broker.RSocketBrokerAutoConfiguration$$SpringCGLIB$$0] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-31T09:38:32.141+08:00  INFO 24477 --- [           main] o.s.c.f.web.flux.FunctionHandlerMapping  : FunctionCatalog: org.springframework.cloud.function.context.catalog.BeanFactoryAwareFunctionRegistry@62b0bf85
2023-10-31T09:38:32.252+08:00  INFO 24477 --- [           main] c.a.r.listen.impl.RSocketListenerImpl    : RST-100001: Succeed to start RSocket Responder on tcp://0.0.0.0:9999
2023-10-31T09:38:32.407+08:00  INFO 24477 --- [           main] o.s.b.web.embedded.netty.NettyWebServer  : Netty started on port 9998
2023-10-31T09:38:32.439+08:00  INFO 24477 --- [           main] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 17 endpoint(s) beneath base path '/actuator'
2023-10-31T09:38:32.461+08:00  INFO 24477 --- [           main] o.s.b.web.embedded.netty.NettyWebServer  : Netty started on port 9997
2023-10-31T09:38:32.472+08:00  INFO 24477 --- [           main] c.g.c.brokerserver.BrokerServerAppKt     : Started BrokerServerAppKt in 1.94 seconds (process running for 2.403)
[2023-10-31T09:38:38.671] RST-300203: App uid-service with IP 192.168.254.249 Online now!
2023-10-31T09:38:38.671+08:00  INFO 24477 --- [tor-tcp-epoll-3] b.r.b.r.RSocketBrokerHandlerRegistryImpl : RST-500200: Succeed to accept connection from uid-service
2023-10-31T09:38:38.671+08:00  INFO 24477 --- [tor-tcp-epoll-2] b.r.b.r.RSocketBrokerHandlerRegistryImpl : RST-500200: Succeed to accept connection from uid-service
[2023-10-31T09:40:38.376] RST-300203: App uid-service with IP 192.168.254.249 Online now!
2023-10-31T09:40:38.376+08:00  INFO 24477 --- [tor-tcp-epoll-4] b.r.b.r.RSocketBrokerHandlerRegistryImpl : RST-500200: Succeed to accept connection from uid-service
2023-10-31T09:41:23.389+08:00  INFO 24477 --- [tor-tcp-epoll-2] b.r.b.r.RSocketBrokerHandlerRegistryImpl : RST-500202: Succeed to remove broker handler
[2023-10-31T09:41:23.389] RST-300204: App uid-service with IP 192.168.254.249 Offline now!

有疑问的地方在于:uid-service 启动后持续运行,中间没有中断过,为何 appNotificationProcessor 发射了多个 uid-service 在线信号,并在大约3分钟后发射应用下线信号(但实际上仍能正常请求该应用提供的服务)?