Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-2564

Invocation of stop on the embedded Sun JDK HttpServer seems to delay connections being closed in Windows

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 3.12.0.Final, 4.5.5.Final
    • None
    • None
    • None

      The org.jboss.resteasy.plugins.server.sun.http.SunHttpJaxrsServer uses the com.sun.net.httpserver.HttpServer as the backing server. The HttpServer.stop(int) method was set to use 0 for the delay. On Windows this seems to take longer to actually close than expected. During tests there may be an attempt to start a new server before the previous one actually closes the connection.

      There are two ways this could be fix.

      1. We use an arbitrary 10 second delay like the VertxJaxrsServer does.
      2. We support a timeout passed to the constructor which would then be passed as the delay to the HttpServer.stop() method.
        • Note That if we use this approach it should likely be supported for the other EmbeddedJaxrsServer's

            jperkins-rhn James Perkins
            jperkins-rhn James Perkins
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: