panzhongxian / blog-comments

0 stars 0 forks source link

cn/2020/08/hot-restart/ #2

Open utterances-bot opened 3 years ago

utterances-bot commented 3 years ago

网关热重启 - 潘忠显

https://www.panzhongxian.cn/cn/2020/08/hot-restart/

vector20240801 commented 3 years ago

envoy的hot restart不是基于SO_REUSEPORT实现的吧 他是直接把父进程监听socket fd取出来了,然后就直接操作这fd实现的吧? 通过调用这个函数实现的 HotRestartImpl::duplicateParentListenSocket 核心逻辑是这个函数HotRestartingParent::Internal::getListenSocketsForChild 我这么理解对不?

panzhongxian commented 3 years ago

@taojiaenx 你的理解是对的,我这里只是大概介绍一下SO_REUSEPORT,作者只是提到并且介绍了没使用它的原因:

In the current implementation Envoy does not make use of the SO_REUSEPORT socket option. This is primarily historical since that socket option is only available on relatively new kernels