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

Implement Eclipse Jetty core HTTP handler adapter #32097

Open
wants to merge 64 commits into
base: main
Choose a base branch
from

Conversation

gregw
Copy link

@gregw gregw commented Jan 24, 2024

This provides an implementation of a HTTP Handler Adaptor that is coded directly to the Eclipse Jetty core API, bypassing any servlet implementation.

Fixes #32035

@pivotal-cla
Copy link

@gregw Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jan 24, 2024
@gregw
Copy link
Author

gregw commented Jan 24, 2024

@pivotal-cla Working on getting a CCLA signed. Stand by....


@Override
public <T> T getNativeRequest() {
return null;
Copy link
Author

Choose a reason for hiding this comment

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

@lachlan-roberts this could be the ServerRequest passed into the builder?

@gregw
Copy link
Author

gregw commented Feb 1, 2024

@lachlan-roberts can you sign the individual CLA.

@gregw
Copy link
Author

gregw commented Feb 1, 2024

This PR is failing 2 tests that undertow also fails: See #25310.
Thus I'm currently suspecting bad tests or a spring bug, as both Jetty core and undertow are similar fully asynchronous integrations without servlets. We will investigate more, but any ideas that can help...

@pivotal-cla
Copy link

@gregw Thank you for signing the Contributor License Agreement!

@gregw gregw marked this pull request as ready for review February 1, 2024 01:52
Comment on lines 133 to 138
// TODO: Why does intellij warn about possible blocking call?
// Because it can block and we want to be fully asynchronous. Use AsynchronousFileChannel
SeekableByteChannel channel = Files.newByteChannel(file, StandardOpenOption.READ);
Copy link
Author

Choose a reason for hiding this comment

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

Files.newByteChannel is a blocking operation, but I see that undertow also use it and just live with the warning. The chance of it actually blocking for any significant time is vanishingly small and there is no chance of dead lock.

// this.dataBuffer = dataBufferFactory.wrap(BufferUtil.copy(chunk.getByteBuffer())); // TODO this copy avoids multipart bugs
this.dataBuffer = dataBufferFactory.wrap(chunk.getByteBuffer()); // TODO avoid double slice?
Copy link
Author

Choose a reason for hiding this comment

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

This is the work around for the failing multipart tests (see #25310)

@jhoeller jhoeller added the in: web Issues in web modules (web, webmvc, webflux, websocket) label Feb 5, 2024
lachlan-roberts and others added 5 commits February 12, 2024 17:17
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan.p.roberts@gmail.com>
Signed-off-by: Lachlan Roberts <lachlan.p.roberts@gmail.com>
Signed-off-by: Lachlan Roberts <lachlan.p.roberts@gmail.com>
@gregw gregw marked this pull request as draft February 14, 2024 09:02
@gregw gregw marked this pull request as ready for review March 7, 2024 15:53
@gregw
Copy link
Author

gregw commented Mar 22, 2024

@jhoeller Is there anything process wise that we need to do to move this PR on? It would be good to get some review to make sure we are on the right path.

@gregw
Copy link
Author

gregw commented Apr 4, 2024

@jhoeller @bclozel @sbrannen What can we do to move this PR on? I'm sure there is lots that we need to update, but we need review to know what that is.

gregw and others added 4 commits April 4, 2024 14:26
Signed-off-by: Lachlan Roberts <lachlan.p.roberts@gmail.com>
Signed-off-by: Lachlan Roberts <lachlan.p.roberts@gmail.com>
@poutsma poutsma self-assigned this Apr 16, 2024
@poutsma
Copy link
Contributor

poutsma commented Apr 16, 2024

@gregw Hi Greg, sorry for the recent lack of feedback. I plan to take a look at this PR soon, and hopefully we can merge it in 6.2 M2 or M3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an Eclipse Jetty Core HttpHandlerAdaptor
7 participants