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 9.4.22 QueuedThreadPool compatibility #4302

Closed
josephlbarnett opened this issue Oct 24, 2019 · 3 comments
Closed

Jetty 9.4.22 QueuedThreadPool compatibility #4302

josephlbarnett opened this issue Oct 24, 2019 · 3 comments

Comments

@josephlbarnett
Copy link

Per, jetty/jetty.project#4121 QueuedThreadPool implements ThreadFactory, which makes the newThread method public instead of protected. The JettyConnectorThreadPool class in JettyHttpContainerFactory has the newThread method marked as protected, and causes an IllegalAccessError when used at runtime (it also fails to compile if compiled against jetty 9.4.22):

java.lang.IllegalAccessError: 'java.lang.Thread org.glassfish.jersey.jetty.JettyHttpContainerFactory$JettyConnectorThreadPool.newThread(java.lang.Runnable)'
	at org.eclipse.jetty.util.thread.QueuedThreadPool.startThread(QueuedThreadPool.java:655)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.ensureThreads(QueuedThreadPool.java:642)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.doStart(QueuedThreadPool.java:182)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
	at org.eclipse.jetty.server.Server.start(Server.java:407)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:117)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:106)
	at org.eclipse.jetty.server.Server.doStart(Server.java:371)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
	at org.glassfish.jersey.jetty.servlet.JettyWebContainerFactory.create(JettyWebContainerFactory.java:257)
	at org.glassfish.jersey.jetty.servlet.JettyWebContainerFactory.create(JettyWebContainerFactory.java:282)
josephlbarnett pushed a commit to trib3/leakycauldron that referenced this issue Oct 24, 2019
Bumps `version.jetty` from 9.4.21.v20190926 to 9.4.22.v20191022.

Updates `jetty-servlets` from 9.4.21.v20190926 to 9.4.22.v20191022
- [Release notes](https://github.com/eclipse/jetty.project/releases)
- [Commits](jetty/jetty.project@jetty-9.4.21.v20190926...jetty-9.4.22.v20191022)

Updates `jetty-server` from 9.4.21.v20190926 to 9.4.22.v20191022
- [Release notes](https://github.com/eclipse/jetty.project/releases)
- [Commits](jetty/jetty.project@jetty-9.4.21.v20190926...jetty-9.4.22.v20191022)

Updates `websocket-api` from 9.4.21.v20190926 to 9.4.22.v20191022

Updates `websocket-common` from 9.4.21.v20190926 to 9.4.22.v20191022

Updates `websocket-client` from 9.4.21.v20190926 to 9.4.22.v20191022

Updates `websocket-server` from 9.4.21.v20190926 to 9.4.22.v20191022

Updates `websocket-servlet` from 9.4.21.v20190926 to 9.4.22.v20191022

Update JettyWebTestContainerFactory to work around jetty breaking
change: eclipse-ee4j/jersey#4302

Signed-off-by: dependabot-preview[bot] <[email protected]>
josephlbarnett pushed a commit to trib3/leakycauldron that referenced this issue Oct 24, 2019
Bumps `version.jetty` from 9.4.21.v20190926 to 9.4.22.v20191022.

Updates `jetty-servlets` from 9.4.21.v20190926 to 9.4.22.v20191022
- [Release notes](https://github.com/eclipse/jetty.project/releases)
- [Commits](jetty/jetty.project@jetty-9.4.21.v20190926...jetty-9.4.22.v20191022)

Updates `jetty-server` from 9.4.21.v20190926 to 9.4.22.v20191022
- [Release notes](https://github.com/eclipse/jetty.project/releases)
- [Commits](jetty/jetty.project@jetty-9.4.21.v20190926...jetty-9.4.22.v20191022)

Updates `websocket-api` from 9.4.21.v20190926 to 9.4.22.v20191022

Updates `websocket-common` from 9.4.21.v20190926 to 9.4.22.v20191022

Updates `websocket-client` from 9.4.21.v20190926 to 9.4.22.v20191022

Updates `websocket-server` from 9.4.21.v20190926 to 9.4.22.v20191022

Updates `websocket-servlet` from 9.4.21.v20190926 to 9.4.22.v20191022

Update JettyWebTestContainerFactory to work around jetty breaking
change: eclipse-ee4j/jersey#4302

Signed-off-by: dependabot-preview[bot] <[email protected]>
@joakime
Copy link
Member

joakime commented Oct 24, 2019

You don't need to customize the QueuedThreadPool any more.
Use the java.util.concurrent.ThreadFactory itself, and pass it into the QueuedThreadPool constructor.

See: https://www.eclipse.org/jetty/javadoc/current/org/eclipse/jetty/util/thread/QueuedThreadPool.html#%3Cinit%3E(int,int,int,int,java.util.concurrent.BlockingQueue,java.lang.ThreadGroup,java.util.concurrent.ThreadFactory)

@jansupol
Copy link
Contributor

jansupol commented Oct 25, 2019

I agree with making the method public. We probably should not rely on the new QueuedThreadPool constructor which is available in the latest Jetty only, yet, so that people can switch back to a previous version of Jetty, should they need it.

We may change it later.

@NielsDoucet
Copy link

@jansupol This incompatibility causes a bug for anyone using the spring-boot-dependencies bom as a baseline for version management (see spring-projects/spring-boot#19769).
In spring boot they are unable to change the minor version of both jetty and jersey due to various reasons (see linked ticket for details).

I asked about options on the jetty project (see jetty/jetty.project#4121), but in parallel I'd like to ask whether there is a possibility of a special 2.29.x release compatible with the new jetty API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants