-
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
Fixes #5498 ServletHolder cleanup #5514
Conversation
Various cleanups including: + renaming multiple `_servlet` fields in inner classes to avoid confusion + better comments in prepare method to describe why it is needed + call prepare from Invoker servlet + The `_servlet` field is not set until after the servlet is initialized + Consistent wrapping of `SingleThreadedWrapper` now in `initServlet` + The `getServlet` method now looks the volatile `_servlet` to avoid locking if possible + The `handle` method now calls `getServletInstance` as servlet will have been initialized in `prepare`
Various cleanups including: + renaming multiple `_servlet` fields in inner classes to avoid confusion + better comments in prepare method to describe why it is needed + call prepare from Invoker servlet + The `_servlet` field is not set until after the servlet is initialized + Consistent wrapping of `SingleThreadedWrapper` now in `initServlet` + The `getServlet` method now looks the volatile `_servlet` to avoid locking if possible + The `handle` method now calls `getServletInstance` as servlet will have been initialized in `prepare` + Found and fixed race with making unavaiable servlet available again
…98-ServletHolder-cleanup
…98-ServletHolder-cleanup
@joakime @janbartel @lorban nudge |
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.
Your changes look alright, but I found an unrelated bug caused by a mis-use of System.nanoTime()
.
jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHolder.java
Outdated
Show resolved
Hide resolved
jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHolder.java
Outdated
Show resolved
Hide resolved
jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHolder.java
Outdated
Show resolved
Hide resolved
+ fixed nanotime overflow + fixed several compiler warnings/suggestions
jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHolder.java
Outdated
Show resolved
Hide resolved
+ removed while true from unavailable servlet
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.
LGTM
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.
I'm gonna have to retract my LGTM.
jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHolder.java
Outdated
Show resolved
Hide resolved
+ Do not destroy servlets unless init has been called. + Added TODOs about calling predestroy on instances not created by the holder.
+ Do not destroy servlets unless init has been called. + Added TODOs about calling predestroy on instances not created by the holder. + improved dump and toString
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.
LGTM
Why are we even letting people pull the I question this entirely. |
Well perhaps make it private rather than public, but we still need the basic logic..... but making it private is a bridge too far for 9 I think. |
Various cleanups for #5498 including:
_servlet
fields in inner classes to avoid confusion_servlet
field is not set until after the servlet is initializedSingleThreadedWrapper
now ininitServlet
getServlet
method now looks the volatile_servlet
to avoid locking if possiblehandle
method now callsgetServletInstance
as servlet will have been initialized inprepare