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

[do not review] feat: TlsSocket AsyncWriteSome and AsyncReadSome #376

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kostasrim
Copy link
Contributor

@kostasrim kostasrim commented Jan 31, 2025

Implement async io for TlsSocket.

  • add AsyncReadSome
  • add AsyncWriteSome
  • add tests
  • add tls certificates

Resolves #361 when ready.

There are a few things that need to be fixed/implemented:

  1. "Yield" when there a pending read or write (to avoid deadlock) see HandleOp comments.
  2. Clean up the state such that progress callbacks can call async io again.
  3. Clean up the main loop of AsyncWrite and control flow.
  4. Improve testing(coverage): a) force tls protocol renegotiation b) send a lot data back and forth.

@kostasrim
Copy link
Contributor Author

Do not review, it's not ready

@@ -388,6 +388,7 @@ void EpollSocket::AsyncWriteSome(const iovec* v, uint32_t len, io::AsyncProgress
async_write_pending_ = 1;
}

// TODO implement async functionality
void EpollSocket::AsyncReadSome(const iovec* v, uint32_t len, io::AsyncProgressCb cb) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

epoll AsyncRead is synchronous

@@ -0,0 +1,34 @@
-----BEGIN CERTIFICATE-----
Copy link
Contributor Author

@kostasrim kostasrim Feb 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think 50 years will be enough for this to last 🤓 (that's the --days I used to generate it)

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 84.56140% with 44 lines in your changes missing coverage. Please review.

Project coverage is 77.67%. Comparing base (d30de86) to head (701425a).
Report is 148 commits behind head on master.

Files with missing lines Patch % Lines
util/tls/tls_socket.cc 71.42% 42 Missing ⚠️
util/tls/tls_socket_test.cc 98.50% 2 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #376      +/-   ##
==========================================
+ Coverage   77.60%   77.67%   +0.06%     
==========================================
  Files         103      112       +9     
  Lines        7824     9557    +1733     
==========================================
+ Hits         6072     7423    +1351     
- Misses       1752     2134     +382     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

implement tls_socket async write/read
2 participants