Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize: check network before listening for memfd #57

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

jizhuozhi
Copy link
Contributor

@jizhuozhi jizhuozhi commented Oct 19, 2024

What type of PR is this?

optimize

Check the PR title.

  • This PR title match the format: <type>(optional scope): <description>
  • The description of this PR title is user-oriented and clear enough for others to understand.
  • Attach the PR updating the user documentation if the current PR requires user awareness at the usage level. User docs repo

(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始终会错误的运行着

		session, err := newSession(&configCopy, conn, false)
		if err != nil {
			conn.Close()
			l.logger.warnf("new server session failed, reason" + err.Error())
			continue
		}

在云原生环境下配置的变更都会伴随着滚动更新实例,如果能够前置在绑定监听前判断类型是否不一致就可以快速失败,并且由于滚动更新检查失败不会将配置错误的问题持续放大

(Optional) Which issue(s) this PR fixes:

(optional) The PR that updates user documentation:

@zhquzzuli zhquzzuli merged commit a5e0aef into cloudwego:main Oct 28, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants