optimize: check network before listening for memfd #57
+19
−12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
optimize
Check the PR title.
(Optional) Translate the PR title into Chinese.
当IPC类型为memfd时,在服务端监听前检查网络类型
(Optional) More detailed description for this PR(en: English/zh: Chinese).
en:
zh(optional): 目前的实现是当Listener完成绑定监听后,直到第一个请求时才会检查配置IPC类型为memfd时是否是通过Unix套接字监听的(因为cmsg限制必须使用unix套接字),如果配置错误则会拒绝此次连接。但是由于此时server已经启动完成,此时处理连接错误不会停止服务,用户需要观察日志才能有所感知,这意味着server始终会错误的运行着
在云原生环境下配置的变更都会伴随着滚动更新实例,如果能够前置在绑定监听前判断类型是否不一致就可以快速失败,并且由于滚动更新检查失败不会将配置错误的问题持续放大
(Optional) Which issue(s) this PR fixes:
(optional) The PR that updates user documentation: