Skip to content

[BUG] Performance Analyzer webserver on port 9600 not responding to any API calls (caused by JDK upgrade?) #545

@borutlukic

Description

@borutlukic

What is the bug?
Opensearch performance analyzer app throws exception on startup and is not working.

How can one reproduce the bug?
Steps to reproduce the behavior:

  1. Run opensearch from docker image: opensearchproject/opensearch:2.12.0 expose port 9600
  2. GET localhost:9600/_plugins/_performanceanalyzer/metrics
  3. Hangs indefinitely (aka, no response is ever returned)

What is the expected behavior?
Expected is that the webserver API on port 9600 returns a response.

What is your host/environment?

  • OS: opensearchproject/opensearch:2.12.0
  • Version 2.12.0
  • Plugins

Do you have any additional context?
See logs/PerformanceAnalyzer.log and notice:

Exception in thread "main" java.lang.IllegalArgumentException: cannot add context to list
        at jdk.httpserver/sun.net.httpserver.ContextList.add(ContextList.java:37)
        at jdk.httpserver/sun.net.httpserver.ServerImpl.createContext(ServerImpl.java:276)
        at jdk.httpserver/sun.net.httpserver.HttpServerImpl.createContext(HttpServerImpl.java:74)
        at jdk.httpserver/sun.net.httpserver.HttpServerImpl.createContext(HttpServerImpl.java:39)
        at org.opensearch.performanceanalyzer.PerformanceAnalyzerApp.createClientServers(PerformanceAnalyzerApp.java:354)
        at org.opensearch.performanceanalyzer.PerformanceAnalyzerApp.createClientServers(PerformanceAnalyzerApp.java:319)
        at org.opensearch.performanceanalyzer.PerformanceAnalyzerApp.main(PerformanceAnalyzerApp.java:112)

Checking the source code it is clear that the same handler is added twice, so the createContext functions throws an exception on the second attempt.
Code from PerformanceAnalyzerApp.java:

            httpServer.createContext(Util.METRICS_QUERY_URL, queryMetricsRequestHandler);
            httpServer.createContext(
                    Util.LEGACY_OPENDISTRO_METRICS_QUERY_URL, queryMetricsRequestHandler);

The Util.METRICS_QUERY_URL and Util.LEGACY_OPENDISTRO_METRICS_QUERY_URL are equal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions