You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "wuzhuoquan (via GitHub)" <gi...@apache.org> on 2023/04/10 10:02:40 UTC

[GitHub] [dubbo] wuzhuoquan opened a new issue, #12055: consumer 该如何设置才能支持 graceful shutdown?

wuzhuoquan opened a new issue, #12055:
URL: https://github.com/apache/dubbo/issues/12055

   <!-- If you need to report a security issue please visit https://github.com/apache/dubbo/security/policy -->
   
   - [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
   
   ## consumer 该如何设置才能支持 graceful shutdown?
   我在测试 dubbo3 的优雅下线,大概的架构入下
   ![image](https://user-images.githubusercontent.com/49891988/230879836-7b6e114c-96d6-4d32-aacd-57b18b11a2ba.png)
    通过 http 调 consumer 的 /sleep?seconds=xx 接口,consumer 会通过 dubbo 协议去调 provider ,provider sleep xx 秒之后返回 hostname
   通过 http 调 consumer 的 /middlesleep?seconds=xx 接口,consumer 会通过 dubbo 协议调到 middle,然后 middle 通过 dubbo 协议调到 provider,provider sleep xx 秒之后返回 hostname 给 middle 然后返回给 consumer
   
   然后根据 https://cn.dubbo.apache.org/zh-cn/overview/mannual/java-sdk/advanced-features-and-usage/others/graceful-shutdown/ 的配置我给每个服务都加了 
   
   ```
   server:
     shutdown: graceful
   ```
   但是在调用 /sleep 或者 /middlesleep 接口的时候,把 consumer 或者 middle 干掉,最终调用 http 的 curl 都不能正常取得返回结果?
   


-- 
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: notifications-unsubscribe@dubbo.apache.org.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #12055: consumer 该如何设置才能支持 graceful shutdown?

Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on issue #12055:
URL: https://github.com/apache/dubbo/issues/12055#issuecomment-1502552327

   优雅下线是服务端的行为,只有服务端才有下线一说。对于这个 case,consumer 如果要下线的话应该在前置的 http 流量那里进行摘除


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] wuzhuoquan closed issue #12055: consumer 该如何设置才能支持 graceful shutdown?

Posted by "wuzhuoquan (via GitHub)" <gi...@apache.org>.
wuzhuoquan closed issue #12055: consumer 该如何设置才能支持 graceful shutdown?
URL: https://github.com/apache/dubbo/issues/12055


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] wuzhuoquan commented on issue #12055: consumer 该如何设置才能支持 graceful shutdown?

Posted by "wuzhuoquan (via GitHub)" <gi...@apache.org>.
wuzhuoquan commented on issue #12055:
URL: https://github.com/apache/dubbo/issues/12055#issuecomment-1519021712

   > > consumer 对外提供服务的话
   > 
   > 这个已经是 provider 了,所以是需要按 provider 的视角去看的
   > 
   > > 总不能因为自己要实现平滑升级,就需要外部客户端必须要做重试机制。
   > 
   > 如果全链路都是 dubbo 的话,可以通过 dubbo 提前下线,等待一段时间后在关闭,这个是不需要考虑自己是服务端还是客户端的
   
   使用 3.2.0 测试,可以正常关闭同时作为 consumer 和 provider 的组件了,以上情况,无论是在关闭 provider、consumer、middle 的时候都可以正常返回数据了。


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #12055: consumer 该如何设置才能支持 graceful shutdown?

Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on issue #12055:
URL: https://github.com/apache/dubbo/issues/12055#issuecomment-1505099151

   > consumer 对外提供服务的话
   
   这个已经是 provider 了,所以是需要按 provider 的视角去看的
   
   > 总不能因为自己要实现平滑升级,就需要外部客户端必须要做重试机制。
   
   如果全链路都是 dubbo 的话,可以通过 dubbo 提前下线,等待一段时间后在关闭,这个是不需要考虑自己是服务端还是客户端的


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] wuzhuoquan commented on issue #12055: consumer 该如何设置才能支持 graceful shutdown?

Posted by "wuzhuoquan (via GitHub)" <gi...@apache.org>.
wuzhuoquan commented on issue #12055:
URL: https://github.com/apache/dubbo/issues/12055#issuecomment-1502593035

   > 
   那如果一个服务即作为 provider,又作为 consumer 的场景呢?
   


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] wuzhuoquan commented on issue #12055: consumer 该如何设置才能支持 graceful shutdown?

Posted by "wuzhuoquan (via GitHub)" <gi...@apache.org>.
wuzhuoquan commented on issue #12055:
URL: https://github.com/apache/dubbo/issues/12055#issuecomment-1502625238

   > 优雅下线是服务端的行为,只有服务端才有下线一说。对于这个 case,consumer 如果要下线的话应该在前置的 http 流量那里进行摘除
   
   对于测试中的 /sleep 接口,consumer 到 provider,consumer 在收到 SIGTERM 之后,不等待 provider sleep 完成返回就断开了链接,但是这个时候没有退出,因为检测到还有请求没有完成,等待shutdown timewait 时间过去之后就直接退出,这个过程中 provider 还在 sleep,完成了之后返回,但是因为链接中断了导致返回不了,前面的 curl 命令在 consumer 退出了之后直接报返回为空。
   那么其实 consumer 在下线的时候,就是已经把正在等待 provider 处理完成的请求给抛弃掉了,如果要做到平滑,就需要外部调 consumer 的时候增加重试机制(dubbo 机制之外),consumer 对外提供服务的话,总不能因为自己要实现平滑升级,就需要外部客户端必须要做重试机制。


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org