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

Jetty 12 - Remove WriteFlusher.Listener #9778

Closed
sbordet opened this issue May 16, 2023 · 3 comments · Fixed by #11839
Closed

Jetty 12 - Remove WriteFlusher.Listener #9778

sbordet opened this issue May 16, 2023 · 3 comments · Fixed by #11839
Assignees

Comments

@sbordet
Copy link
Contributor

sbordet commented May 16, 2023

Jetty version(s)
12

Description
WriteFlusher.Listener was introduced to compute the response data rate.
This was necessary because for HTTP/2 or HTTP/3 we do not know often before hand how many bytes are flushed (because we use objects that are serialized just before hitting the network).
Furthermore wrapping with TLS complicates things because of the added wrapping.

However, I think it should now be possible to remove this (expensive) listener mechanism in favor of callbacks.

For HTTP/2, for example, a [Control|Data]Entry knows how many bytes it has generated, and upon completion of its write it can update the number of bytes written (for statistics), and check the minResponseDataRate in the callback inHttpStreamOverHTTP2.send().

This will only take into account clear-text writes (the overhead of a wrapping protocol such as TLS is not counted).

Note that we cannot move the bytes counting to EndPoint because for multiplexed protocols we want to check the minResponseDataRate per-stream, not per-session.

@sbordet sbordet added the Bug For general bugs on Jetty side label May 16, 2023
@sbordet
Copy link
Contributor Author

sbordet commented May 16, 2023

@gregw thoughts?

@gregw
Copy link
Contributor

gregw commented May 16, 2023

@sbordet the less listeners the better

@gregw gregw added Enhancement and removed Bug For general bugs on Jetty side labels May 16, 2023
Copy link

This issue has been automatically marked as stale because it has been a
full year without activity. It will be closed if no further activity occurs.
Thank you for your contributions.

@github-actions github-actions bot added the Stale For auto-closed stale issues and pull requests label May 16, 2024
@sbordet sbordet self-assigned this May 16, 2024
@sbordet sbordet removed the Stale For auto-closed stale issues and pull requests label May 16, 2024
sbordet added a commit that referenced this issue May 24, 2024
This listener is not necessary anymore, as the min data rate checks have been moved to a StatisticsHandler.MinimumDataRateHandler.

Signed-off-by: Simone Bordet <[email protected]>
@sbordet sbordet moved this to 🏗 In progress in Jetty 12.0.10 (FROZEN) May 24, 2024
@sbordet sbordet linked a pull request May 24, 2024 that will close this issue
sbordet added a commit that referenced this issue May 29, 2024
* Fixes #9778 - Jetty 12 - Remove WriteFlusher.Listener.

This listener is not necessary anymore, as the min data rate checks have been moved to a StatisticsHandler.MinimumDataRateHandler.

Signed-off-by: Simone Bordet <[email protected]>
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in Jetty 12.0.10 (FROZEN) May 29, 2024
sbordet added a commit that referenced this issue Jul 19, 2024
WriteFlusher.Listener functionality was removed, and the class deprecated in 12.0.10 as part of the work for #9778 and #11839.

Signed-off-by: Simone Bordet <[email protected]>
sbordet added a commit that referenced this issue Jul 29, 2024
WriteFlusher.Listener functionality was removed, and the class deprecated in 12.0.10 as part of the work for #9778 and #11839.

Signed-off-by: Simone Bordet <[email protected]>
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 a pull request may close this issue.

2 participants