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: connection leak when poller close connection but onRequest callback just finished #304

Merged
merged 1 commit into from
Feb 6, 2024

Conversation

joway
Copy link
Member

@joway joway commented Jan 31, 2024

What type of PR is this?

fix

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.

fix: 当对端关闭连接但是 OnRequest 回调刚刚返回时,连接可能泄漏的问题

(Optional) More detailed description for this PR(en: English/zh: Chinese).

en:
Triggered Case:

  1. client write and wait read
  2. netpoll server OnRequest: read and write , OnRequest returned but still hold processing lock
  3. client read finish and close connection
  4. netpoll server receive EPOLLHUP and detach FD and call closeCallback but try to get processing lock failed
  5. netpoll server OnRequest: release processing lock and return OnRequest
  6. nothing will check connection state again so connection may leak.

Occur mainly in UDS server with short connection client . For TCP case, close a connection may not so quick to pass to server thread so server have a chance to finish OnRequest callback first.

zh(optional):

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

(optional) The PR that updates user documentation:

@joway joway merged commit faa5263 into develop Feb 6, 2024
15 checks passed
@joway joway deleted the fix/conn-leak branch February 6, 2024 07:15
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