-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Issue #9076 - Cleanups and fixes for multipart in Jetty 12 #9287
Conversation
Signed-off-by: Lachlan Roberts <[email protected]>
Signed-off-by: Lachlan Roberts <[email protected]>
Signed-off-by: Lachlan Roberts <[email protected]>
Signed-off-by: Lachlan Roberts <[email protected]>
Signed-off-by: Lachlan Roberts <[email protected]>
Signed-off-by: Lachlan Roberts <[email protected]>
Signed-off-by: Lachlan Roberts <[email protected]>
…9066-MultiPart-getParameters
Signed-off-by: Lachlan Roberts <[email protected]>
Signed-off-by: Lachlan Roberts <[email protected]>
…9066-MultiPart-getParameters
Signed-off-by: Lachlan Roberts <[email protected]>
Signed-off-by: Lachlan Roberts <[email protected]>
Signed-off-by: Lachlan Roberts <[email protected]>
Signed-off-by: Lachlan Roberts <[email protected]>
…9066-MultiPart-getParameters
Signed-off-by: Lachlan Roberts <[email protected]>
Signed-off-by: Lachlan Roberts <[email protected]>
Signed-off-by: Lachlan Roberts <[email protected]>
Signed-off-by: Lachlan Roberts <[email protected]>
…multipartCleanups
jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/MultiPartByteRanges.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/MultiPartFormData.java
Show resolved
Hide resolved
jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/content/ChunksContentSource.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java
Show resolved
Hide resolved
...-ee10/jetty-ee10-servlet/src/main/java/org/eclipse/jetty/ee10/servlet/ServletApiRequest.java
Outdated
Show resolved
Hide resolved
...e9/jetty-ee9-nested/src/main/java/org/eclipse/jetty/ee9/nested/MultiPartFormInputStream.java
Outdated
Show resolved
Hide resolved
jetty-ee9/jetty-ee9-nested/src/main/java/org/eclipse/jetty/ee9/nested/Request.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/MultiPartFormData.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/HttpStream.java
Outdated
Show resolved
Hide resolved
List<Content.Chunk> newChunks = content.stream() | ||
.map(chunk -> Content.Chunk.from(chunk.getByteBuffer().slice(), chunk.isLast())) | ||
.toList(); | ||
return new ChunksContentSource(newChunks); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussing this with @lorban, I think it's best if we store these ChunksContentSource
in a List
, and we fail them all when this part is closed.
The reason is that in this particular case, if a ChunksContentSource
is read after completing the Handler
callback, it can read content from buffers that were returned to the pool and may be used for other requests.
By failing them, we guarantee that if they are read after Handler
completion, an error is returned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if someone calls newContentSource()
after the part has been closed, do we need to keep an atomic state and if this has been closed return them a failed instance of Content.Source
when they call newContentSource()
?
Why can't we just say if this have been closed it is invalid to use it. Just like if you return a RetainableByteBuffer
to the pool it is invalid to continue using it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opened #9336
Signed-off-by: Lachlan Roberts <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix test failures, and then LGTM.
…multipartCleanups
Signed-off-by: Lachlan Roberts <[email protected]>
Signed-off-by: Lachlan Roberts <[email protected]>
Signed-off-by: Lachlan Roberts <[email protected]>
Signed-off-by: Lachlan Roberts <[email protected]>
…x-documentation-operations-logging * upstream/jetty-12.0.x: (35 commits) Fixes jetty#9326 - Rename DecryptedEndPoint to SslEndPoint. Jetty 10 Upgrade to Hazelcast 5 and totally disable auto join multicast etc.. (fix build on CI) (jetty#9331) jetty#9328 - changes from review jetty#9287 - catch error in ee9 maxRequestSize MultiPart test Jetty 12.0.x 9301 fix ee10 jstl jpms (jetty#9321) Issue jetty#9301 Fix dependencies for ee10-glassfish-jstl module (jetty#9303) Jetty 12 Hazelcast 5.x and disable auto detection/multicast" (jetty#9332) jetty#9287 - fix further test failures Fixed imports. Issue jetty#7650 - Fix race condition when stopping QueuedThreadPool (jetty#9325) jetty#9287 - remove unpaired release of Content.Chunk Issue jetty#8991 - rename websocket isDemanding() method to isAutoDemanding() Issue jetty#9287 - fix failing tests changes f rom review add todo to revert to normal pool after fix for jetty#9311 Issue jetty#9309 - Introducing test for requestlog format with spaces use non-pooling RetainableByteBufferPool to work around performance bug consumeAvailable should use number of reads instead of bytes fix for retainable merge changes from review ...
Signed-off-by: Lachlan Roberts <[email protected]>
if (_parser.isTerminated()) | ||
throw new RuntimeIOException("Parser is terminated"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lachlan-roberts @sbordet I think this is causing #12212
Can you recall why this was necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue #9076
MAX_FORM_KEYS_KEY
andMAX_FORM_CONTENT_SIZE_KEY
parameters to configure limits for multipart.Part.delete()
will delete any file storage for that part.newContentSource()
method to get a newContent.Source
every time from the part.