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

Some requests are received and processed twice? #153

Open
derklaro opened this issue Apr 5, 2022 · 0 comments
Open

Some requests are received and processed twice? #153

derklaro opened this issue Apr 5, 2022 · 0 comments

Comments

@derklaro
Copy link

derklaro commented Apr 5, 2022

I'm running on the latest "release" of io_uring (0.0.13.Final). I recently noticed build failures on GitHub Actions which seem the be caused
by io_uring. Removing io_uring and only testing against epoll/kqueue/nio works perfectly fine.

I had originally two issues, one of them I was able to solve myself. However, that might be interesting as well: I have some code which did a websocket handshake, I executed it and called syncUninterruptedly which began to fail as well. Seems like I need to execute/handle that async, wich worked seemlessly a few days ago.

On the other hand I am testing if sent http requests are having the same request method when receiving. In a nutshell this code looks like this:

        Assertions.assertEquals(SUPPORTED_METHODS.get(handledTypes.getAndIncrement()), context.request().method());
        // send ok http response

And I send the request with an HttpUrlConnection:

    for (String supportedMethod : SUPPORTED_METHODS) {
      HttpUrlConnection connection = construct_here;
      connection.setRequestMethod(supportedMethod)
      connection.connect();

      Assertions.assertEquals(200, connection.getResponseCode());
    }

But I receive some requests twice:

    SENDING WITH GET
    GOT GET /// 0 /// IOUringEventLoopGroup-7-1
    SENDING WITH POST
    GOT POST /// 1 /// IOUringEventLoopGroup-7-2
    SENDING WITH HEAD
    GOT HEAD /// 2 /// IOUringEventLoopGroup-7-3
    SENDING WITH OPTIONS
    GOT OPTIONS /// 3 /// IOUringEventLoopGroup-7-3
    GOT OPTIONS /// 4 /// IOUringEventLoopGroup-7-4

or


    SENDING WITH GET
    GOT GET /// 0 /// IOUringEventLoopGroup-7-1
    SENDING WITH POST
    GOT POST /// 1 /// IOUringEventLoopGroup-7-2
    SENDING WITH HEAD
    GOT HEAD /// 2 /// IOUringEventLoopGroup-7-2
    GOT HEAD /// 3 /// IOUringEventLoopGroup-7-3

I'm pretty sure that the request is not sent twice as that test works fine with epoll and nio. I wasn't yet able to validate this, but there was a recent kernel update which changed stuff related to io_uring, maybe it's a good start to check if it works fine on older kernel versions? (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=42a7b4ed45e7667836fae4fb0e1ac6340588b1b0)

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

1 participant