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

QueuedThreadPool not exposed on JMX #1718

Closed
lpandzic opened this issue Aug 8, 2017 · 3 comments
Closed

QueuedThreadPool not exposed on JMX #1718

lpandzic opened this issue Aug 8, 2017 · 3 comments
Assignees
Labels
Bug For general bugs on Jetty side

Comments

@lpandzic
Copy link

lpandzic commented Aug 8, 2017

After upgrading from 9.4.5.v20170502 to 9.4.6.v20170531
MBean "org.eclipse.jetty.util.thread.queuedthreadpool" is no longer exposed on JMX althrough
other jetty JMX MBeans are. QueuedThreadPool is still being constructed.
Any thought about what it might be?

@lpandzic lpandzic changed the title QueuedThreadPool not exposed QueuedThreadPool not exposed on JMX Aug 8, 2017
@sbordet
Copy link
Contributor

sbordet commented Aug 8, 2017

We need more evidence.

QueuedThreadPool is still being constructed

is too vague, as QueuedThreadPool is typically the first object being instantiated, and without it nothing else works.

Start with a barebone server and enable the JMX module. Can you see the QueuedThreadPool MBean ?

@lpandzic
Copy link
Author

After more thorough investigation it was determined that jetty wasn't the cause of the issue so I'm closing it.

@lpandzic lpandzic reopened this Sep 7, 2017
@lpandzic
Copy link
Author

lpandzic commented Sep 7, 2017

After further investigation, I've managed to pinpoint the issue with @wilkinsona.
AFAIK, there is no breaking change on jetty, it simply does not work (on any of the mentioned versions) and this was exposed by spring boot change.
This code reproduces the issue:

public static void main(String[] args) throws Exception {
        Server server = new Server();
        server.addBean(new MBeanContainer(ManagementFactory.getPlatformMBeanServer()));
        ServerConnector connector = new ServerConnector(server);
        connector.setPort(8080);
        server.addConnector(connector);
        server.start();
        checkThreadPoolMBean();
        Connector[] connectors = server.getConnectors();
        server.setConnectors(null);
        checkThreadPoolMBean();
        server.setConnectors(connectors);
        checkThreadPoolMBean();
    }

    private static void checkThreadPoolMBean() throws MalformedObjectNameException {
        ObjectName queuedthreadpool = new ObjectName("org.eclipse.jetty.util.thread:type=queuedthreadpool,id=0");
        try {
            ManagementFactory.getPlatformMBeanServer().getMBeanInfo(queuedthreadpool);
            System.out.println(queuedthreadpool + " was available");
        }
        catch(Exception ex) {
            System.out.println(queuedthreadpool + " was not available");
        }
    }

@sbordet sbordet added the Bug For general bugs on Jetty side label Sep 11, 2017
@sbordet sbordet self-assigned this Sep 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For general bugs on Jetty side
Projects
None yet
Development

No branches or pull requests

2 participants