-
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
Review Jetty-12 DelayedHandler #9051
Comments
I have a draft of this, but it is waiting for #9035 to be merged |
#9056 has improved the implementation and merged the multiple handlers into a single one. |
@sbordet Currently the problematic API is: protected DelayedProcess newDelayedProcess(boolean contentExpected, String contentType, MimeTypes.Type mimeType, Handler handler, Request request, Response response, Callback callback) So first question: Should this handle be able to delay for non-content related purposes? We have no real use-cases, but we do have a test case for that, hence the need to pass A good first simplification could be to rename the handler to protected DelayedProcess newDelayedProcess(String contentType, MimeTypes.Type mimeType, Handler handler, Request request, Response response, Callback callback) We are passing both protected DelayedProcess newDelayedProcess(String contentType, Handler handler, Request request, Response response, Callback callback) Alternately, we could have a protected DelayedProcessFactory getDelayedProcessFactory(String contentType);
interface DelayedProcessFactory
{
DelayedProcess newDelayedProcess(Handler handler, Request request, Response response, Callback callback);
} But multipart and other delays would need to wrap the factory to remember the boundary. I'm not sure the extensibility needs of this class justify a factory. On balance, I think the version that just takes the String content-type is a good simplification, so long as we agree that this handler only delays content and no other reason? |
…9056) * Improved javadoc * Refactored ThreadLimitHandler to avoid lambda creation and to always execute * Refactored DelayedHandler to avoid lambda creation and to execute only if needed * added modules for the DelayedHandler Signed-off-by: Simone Bordet <simone.bordet@gmail.com> Signed-off-by: Greg Wilkins <gregw@webtide.com> Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
This issue has been automatically marked as stale because it has been a |
@sbordet I'm bumping this to 12.1.0 and think we should consider re-introducing the built in HTTP/1 delayed dispatch (on by default) and making this handler less general purpose. |
@sbordet @lorban @lachlan-roberts I'm going to reintroduce delayed dispatch to HttpConnection. Can you guys look at doing the same for h2 and h3. I think the DelayedHandler should then only be used for asynchronously reading entire contents before dispatch (probably renamed) |
Fix #9051 with EagerContentHandler to replace DelayedHandler The make the EagerContentHandler.RetainedContentLoader work efficiently this PR adjusted the buffering strategy of h1, h2 and h3 to keep and reuse a retained buffer until it is mostly full. Also fixed several bugs in XmlConfiguration: + A Set could not be used with a builder style method (kind of missing feature more than a bug) + If a property element was used in a Set it could only be a string and the type element was ignored. + When trying to find a native match, the vClass local variable was overwritten with the native TYPE being tried. This affected subsequent match attempts using the wrong vClass --------- Signed-off-by: Lachlan Roberts <lachlan.p.roberts@gmail.com> Signed-off-by: gregw <gregw@webtide.com> Signed-off-by: Simone Bordet <simone.bordet@gmail.com> Co-authored-by: Lachlan Roberts <lachlan.p.roberts@gmail.com> Co-authored-by: Simone Bordet <simone.bordet@gmail.com> Co-authored-by: Ludovic Orban <lorban@bitronix.be>
Jetty version(s)
12
Enhancement Description
Jetty-12 has generalized the previous jetty delayed dispatch mechanism. Currently there are
Handler
s that can delay dispatch until:However, it is possible that a deployment might need multiples of these behaviors and it is undesirable to have 3 such handlers stacked up. Thus we should consider refactoring so that there is a single
DelayedHandler
that can optionally perform various types of delay depending on content-type.Furthermore, whilst the downstream handling of forms appears to have been updated to use any form read by this handler, the same has not been done for multiparts. The same pattern of looking for the processed content in the request attributes should be applied to parts.
The text was updated successfully, but these errors were encountered: