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

Support IO_URING transport #4163

Closed
franz1981 opened this issue Nov 9, 2021 · 6 comments · Fixed by #4164
Closed

Support IO_URING transport #4163

franz1981 opened this issue Nov 9, 2021 · 6 comments · Fixed by #4164
Milestone

Comments

@franz1981
Copy link
Contributor

I'm implementing support for https://github.com/netty/netty-incubator-transport-io_uring on Vert-x Transport, see https://github.com/franz1981/vert.x/tree/4.2.1_iouring for some initial experiment.

@franz1981
Copy link
Contributor Author

There are some test failures related missing sendFile support that I'm working around by forcing supportsFileRegion to return false with IoUring on ConnectionBase::sendFile:

  public final ChannelFuture sendFile(RandomAccessFile raf, long offset, long length) throws IOException {
    // Write the content.
    ChannelPromise writeFuture = chctx.newPromise();
    if (!supportsFileRegion()) {
      // Cannot use zero-copy
      writeToChannel(new ChunkedFile(raf, offset, length, 8192), writeFuture);
    } else {
      // No encryption - use zero-copy.
      sendFileRegion(raf, offset, length, writeFuture);
    }
    if (writeFuture != null) {
      writeFuture.addListener(fut -> raf.close());
    } else {
      raf.close();
    }
    return writeFuture;
  }

The downside is that writeToChannel too doesn't seems to work correctly and I'm investigating what's going on.

@franz1981
Copy link
Contributor Author

I've fixed #4163 (comment) with franz1981@4eafe9f

@franz1981
Copy link
Contributor Author

franz1981 commented Nov 9, 2021

Just FYI this is the last run:

Results :

Failed tests: 
  Http1xTest>HttpTest.testListenDomainSocketAddress:144->HttpTestBase.startServer:93->HttpTestBase.startServer:118->AsyncTestBase.awaitLatch:598->AsyncTestBase.awaitLatch:602->AsyncTestBase.assertTrue:378 null
  Http2ClientTest.lambda$testNetSocketConnect$198:1428->AsyncTestBase.assertEquals:241 expected:<2> but was:<1>
  Http2ServerTest.lambda$testNetSocketConnect$250:2251->AsyncTestBase.assertEquals:241 expected:<2> but was:<1>
  Http2Test>HttpTest.testListenDomainSocketAddress:144->HttpTestBase.startServer:93->HttpTestBase.startServer:118->AsyncTestBase.awaitLatch:598->AsyncTestBase.awaitLatch:602->AsyncTestBase.assertTrue:378 null
  Http2Test>HttpTest.lambda$testServerConnectionHandlerClose$573:3625->AsyncTestBase.fail:414 null
  NetTest.testListenDomainSocketAddress:1896->startServer:3843->startServer:3855->AsyncTestBase.awaitLatch:598->AsyncTestBase.awaitLatch:602->AsyncTestBase.assertTrue:378 null
  NetTest.access$2400:77->AsyncTestBase.assertEquals:360 expected:<true> but was:<false>
Tests in error: 
  DatagramTest.testPauseResume:209->AsyncTestBase.await:121->AsyncTestBase.await:133 » IllegalState
  Http1xTest>AsyncTestBase.after:83->HttpTestBase.tearDown:69->VertxTestBase.tearDown:87->AsyncTestBase.close:662->AsyncTestBase.awaitLatch:598->AsyncTestBase.awaitLatch:602->AsyncTestBase.assertTrue:380->AsyncTestBase.handleThrowable:183 » IllegalState
  Http2MetricsTest.testPushPromise:99->AsyncTestBase.await:121->AsyncTestBase.await:133 » IllegalState
  Http2MetricsTest>AsyncTestBase.after:83->HttpMetricsTestBase.tearDown:54->HttpTestBase.tearDown:69->VertxTestBase.tearDown:87->AsyncTestBase.close:662->AsyncTestBase.awaitLatch:598->AsyncTestBase.awaitLatch:602->AsyncTestBase.assertTrue:380->AsyncTestBase.handleThrowable:183 » IllegalState
  Http2MetricsTest>AsyncTestBase.after:83->HttpMetricsTestBase.tearDown:54->HttpTestBase.tearDown:69->VertxTestBase.tearDown:87->AsyncTestBase.close:662->AsyncTestBase.awaitLatch:598->AsyncTestBase.awaitLatch:602->AsyncTestBase.assertTrue:380->AsyncTestBase.handleThrowable:183 » IllegalState
  Http2ServerTest.testUpgradeToClearTextGet:2546->testUpgradeToClearText:2607->AsyncTestBase.await:121->AsyncTestBase.await:133 » IllegalState
  Http2Test>AsyncTestBase.after:83->HttpTestBase.tearDown:69->VertxTestBase.tearDown:87->AsyncTestBase.close:662->AsyncTestBase.awaitLatch:598->AsyncTestBase.awaitLatch:602->AsyncTestBase.assertTrue:380->AsyncTestBase.handleThrowable:183 » IllegalState
  NetTest>AsyncTestBase.after:83->tearDown:129->VertxTestBase.tearDown:87->AsyncTestBase.close:662->AsyncTestBase.awaitLatch:598->AsyncTestBase.awaitLatch:602->AsyncTestBase.assertTrue:380->AsyncTestBase.handleThrowable:183 » IllegalState
  NetTest.testStartTLSClientCertClientNotTrusted:1317->testTLS:1571->testTLS:1601->AsyncTestBase.await:121->AsyncTestBase.await:133 » IllegalState

Tests run: 4760, Failures: 7, Errors: 9, Skipped: 14

And many of these tests shouldn't run because are using domain socket, that's still not supported

I'm going to prepare a draft PR ASAP

@tsegismont
Copy link
Contributor

tsegismont commented Nov 9, 2021 via email

franz1981 added a commit to franz1981/vert.x that referenced this issue Nov 9, 2021
franz1981 added a commit to franz1981/vert.x that referenced this issue Nov 9, 2021
@vietj vietj added this to the 4.2.2 milestone Nov 10, 2021
franz1981 added a commit to franz1981/vert.x that referenced this issue Nov 10, 2021
@vietj
Copy link
Member

vietj commented Nov 10, 2021

The transport should be optional and only used when the jar is present on the classpath and native epoll is not present

franz1981 added a commit to franz1981/vert.x that referenced this issue Nov 10, 2021
@Sanne
Copy link
Contributor

Sanne commented Nov 10, 2021

The transport should be optional and only used when the jar is present on the classpath and native epoll is not present

Haven't checked the latest version of the code, but that's how it was working when I tested an early preview.

franz1981 added a commit to franz1981/vert.x that referenced this issue Nov 11, 2021
@vietj vietj modified the milestones: 4.2.2, 4.2.3, 4.2.4 Dec 14, 2021
@vietj vietj modified the milestones: 4.2.4, 4.2.5 Jan 20, 2022
@vietj vietj modified the milestones: 4.2.5, 3.9.12, 4.3.0 Feb 14, 2022
@vietj vietj modified the milestones: 4.3.0, 4.3.1 May 12, 2022
franz1981 added a commit to franz1981/vert.x that referenced this issue May 25, 2022
@vietj vietj modified the milestones: 4.3.1, 4.3.2 May 25, 2022
@vietj vietj removed this from the 4.3.2 milestone Jul 6, 2022
@vietj vietj added this to the 4.3.3 milestone Jul 6, 2022
@vietj vietj modified the milestones: 4.3.3, 4.3.4 Aug 9, 2022
@vietj vietj modified the milestones: 4.3.4, 4.3.5 Oct 1, 2022
@vietj vietj modified the milestones: 4.3.5, 4.4.0 Nov 18, 2022
franz1981 added a commit to franz1981/vert.x that referenced this issue Dec 2, 2022
franz1981 added a commit to franz1981/vert.x that referenced this issue Dec 5, 2022
franz1981 added a commit to franz1981/vert.x that referenced this issue Feb 16, 2023
franz1981 added a commit to franz1981/vert.x that referenced this issue Feb 21, 2023
@vietj vietj closed this as completed in f80519d Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants