Skip to content

Addendum to #12927 for #12916.#12931

Merged
sbordet merged 12 commits into
jetty-12.0.xfrom
fix/jetty-12.0.x/12916/inputstreamresponselistener-autocloseable2
Mar 25, 2025
Merged

Addendum to #12927 for #12916.#12931
sbordet merged 12 commits into
jetty-12.0.xfrom
fix/jetty-12.0.x/12916/inputstreamresponselistener-autocloseable2

Conversation

@sbordet

@sbordet sbordet commented Mar 23, 2025

Copy link
Copy Markdown
Contributor
  • Fixed InputStreamResponseListener.close() to properly flip the closed field.
  • Made InputStreamResponseListener.close() and InputStreamResponseListener.Input.close() call the same code.
  • Fixed buffer leaking by releasing the network buffer upon connection close in HTTP and FCGI.

Fixed InputStreamResponseListener.close() to properly flip the `closed` field.
Made InputStreamResponseListener.close() and InputStreamResponseListener.Input.close() call the same code.
Fixed buffer leaking by releasing the network buffer upon connection close in HTTP and FCGI.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
gregw
gregw previously approved these changes Mar 23, 2025
…ilures.

This causes reads and writes failures to be concurrent, which makes more complicated to control the release of resources such as the network buffer used in reads.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
sbordet added 4 commits March 23, 2025 18:33
A call to completeWrite() may block, so it cannot block the read side as well.
…ly on atomicity of close(Throwable) to release the network buffer.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
A DATA frame could have been enqueued even if the stream was reset or failed, and stay there without being released.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
@Tag("DisableLeakTracking:client:FCGI")
@Tag("DisableLeakTracking:client:UNIX_DOMAIN")
@Tag("flaky")
public void testDownloadWithCloseBeforeContent(Transport transport) throws Exception

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@Tag("DisableLeakTracking:client:H3") should stay.


@ParameterizedTest
@MethodSource("transports")
@Tag("DisableLeakTracking:client")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should be replaced with @Tag("DisableLeakTracking:client:H3")


@ParameterizedTest
@MethodSource("transports")
@Tag("DisableLeakTracking:client")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should be replaced with @tag("DisableLeakTracking:client:H3")

{
if (LOG.isDebugEnabled())
LOG.debug("Error processing {} in {}", endPoint, this, x);
releaseNetworkBuffer();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This certainly deserves a comment that explains close() is going to take care of releasing the buffer but with a thread protection thanks to a CAS.

sbordet added 4 commits March 24, 2025 16:24
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Removed `@Tag` for UNIX_DOMAIN, as the constant does not exist anymore.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
sbordet added 2 commits March 24, 2025 20:00
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
@sbordet sbordet moved this to 👀 In review in Jetty 12.0.19 - FROZEN Mar 24, 2025
@sbordet sbordet linked an issue Mar 24, 2025 that may be closed by this pull request
@sbordet sbordet self-assigned this Mar 24, 2025
@sbordet sbordet merged commit aef5013 into jetty-12.0.x Mar 25, 2025
@github-project-automation github-project-automation Bot moved this from 👀 In review to ✅ Done in Jetty 12.0.19 - FROZEN Mar 25, 2025
@sbordet sbordet deleted the fix/jetty-12.0.x/12916/inputstreamresponselistener-autocloseable2 branch March 25, 2025 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Bad example in JavaDoc of InputStreamResponseListener

3 participants