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

Fix tcp connect interrupt #2664

Merged
merged 2 commits into from
Jul 29, 2024
Merged

Conversation

chenBright
Copy link
Contributor

What problem does this PR solve?

Issue Number:

Problem Summary:

tcp_connect被中断之后,返回结果是有问题的:

  1. bthread_timed_connect / bthread_connectbutex_wait返回0,errno等于EWOULDBLOCK或者EINTR,最后tcp_connect返回一个未连接成功的socket fd。
  2. pthread_timed_connect :返回-1,errno等于EINTR

What is changed and the side effects?

Changed:

当errno等于EWOULDBLOCK或者EINTRpthread_fd_wait / bthread_fd_wait继续wait到连接成功或者失败。

Side effects:

  • Performance effects(性能影响):

  • Breaking backward compatibility(向后兼容性):


Check List:

  • Please make sure your changes are compilable(请确保你的更改可以通过编译).
  • When providing us with a new feature, it is best to add related tests(如果你向我们增加一个新的功能, 请添加相关测试).
  • Please follow Contributor Covenant Code of Conduct.(请遵循贡献者准则).

@chenBright chenBright force-pushed the fix_connect_interrupt branch 2 times, most recently from d477324 to f22a7b9 Compare June 17, 2024 15:51
@chenBright chenBright force-pushed the fix_connect_interrupt branch from f22a7b9 to c5f7da4 Compare June 17, 2024 15:52
src/butil/endpoint.cpp Outdated Show resolved Hide resolved
@chenBright chenBright force-pushed the fix_connect_interrupt branch from f92228f to 5edf24e Compare June 20, 2024 13:12
@chenBright
Copy link
Contributor Author

@wwbmmm 有空看看

@wwbmmm
Copy link
Contributor

wwbmmm commented Jul 26, 2024

LGTM

@wwbmmm wwbmmm merged commit 1bb0fca into apache:master Jul 29, 2024
20 checks passed
@chenBright chenBright deleted the fix_connect_interrupt branch July 31, 2024 15:47
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

Successfully merging this pull request may close these issues.

2 participants