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

更新程序不中断已有的 tcp 连接 #2

Open
knight42 opened this issue Jun 23, 2020 · 2 comments
Open

更新程序不中断已有的 tcp 连接 #2

knight42 opened this issue Jun 23, 2020 · 2 comments
Assignees

Comments

@knight42
Copy link
Member

No description provided.

@knight42 knight42 self-assigned this Jun 23, 2020
@knight42 knight42 changed the title 更新配置不中断已有的 tcp 连接 更新程序不中断已有的 tcp 连接 Jun 23, 2020
@iBug
Copy link
Member

iBug commented Jan 12, 2023

考察了一下各种方案,由于技术限制,zero-downtime 和跨平台(其实也就是支持 Windows)两个特性只能二选一。简而言之,原因是 Windows 没有 SO_REUSEPORT 这种东西。

我倾向于放弃跨平台实现 Linux-only 的 zero-downtime,这样有一些很方便现成的库可以用,例如 cloudflare/tableflip

@iBug
Copy link
Member

iBug commented Jan 15, 2023

讨论了一下,需要考虑的事情有点多:

  • 如何让 systemd 更新进程,同时不要管旧进程(答案:KillMode=none,但这会让旧进程完全失控)
  • 如何处理日志:
    • 写冲突(查资料可知 O_APPEND 可以保证原子追加,但只有“足够小”的 write 操作能保证不会交错)
    • 旧进程的 logrotate 问题(还没写完就被 logrotate 了)

暂定结论是虽然能实现但是会很麻烦,所以决定暂时搁置这个功能。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants