Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6361557

LightWeight http server quickly runs out of available file descriptors on linux.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 6
    • 6
    • core-libs
    • None
    • b78
    • x86
    • linux, windows_xp

      Unpack the test attached.
      Build with ant
      run java -jar build/httpserver-bug.jar

      The test runs HttpServer and invokes repeatingly the following code:

             javax.xml.ws.Service service = Service.create(URL,QNAME);
             Hello hello = service.getPort(Hello.class);
      ***// hello.sayHello();

      after a while the test starts throwing exceptions. The exceptions may be different,
      but command
      ls -1 /proc/[pid of java]/fd | wc -l
      will return something near the maxopenfiles value. On my machine it is 1024

      Also, if uncomment a line marked with stars, the test runs much longer before
      exceptions will appear. Unfortunately in JAXWS tests we do not actually invoke web methods
      in most cases.



      ====== Example of exception ==================
      Unable to create StAX reader or writer
              at com.sun.xml.ws.streaming.XMLStreamReaderFactory.createFreshXMLStreamReader(XMLStreamReaderFactory.java:105)
              at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.createReader(RuntimeWSDLParser.java:140)
              at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parseWSDL(RuntimeWSDLParser.java:165)
              at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:62)
              at com.sun.xml.ws.wsdl.WSDLContext.<init>(WSDLContext.java:60)
              at com.sun.xml.ws.client.ServiceContextBuilder.build(ServiceContextBuilder.java:77)
              at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:113)
              at com.sun.xml.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:50)
              at javax.xml.ws.Service.<init>(Service.java:58)
              at javax.xml.ws.Service.create(Service.java:302)
              at com.sun.testws.Test.execClient(Test.java:53)
              at com.sun.testws.Test.runTest(Test.java:43)
              at com.sun.testws.Test.main(Test.java:61)
      Caused by: java.net.SocketException: Unexpected end of file from server
              at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:688)
              at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:558)
              at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:686)
              at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:558)
              at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:970)
              at java.net.URL.openStream(URL.java:1007)
              at com.sun.xml.ws.streaming.XMLStreamReaderFactory.createFreshXMLStreamReader(XMLStreamReaderFactory.java:100)

            michaelm Michael McMahon
            avishentsunw Alexey Vishentsev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: