Uploaded image for project: 'JBoss Log Manager'
  1. JBoss Log Manager
  2. LOGMGR-314

SocketHandlerTests produce BindException: Address already in use

    XMLWordPrintable

Details

    • Task
    • Resolution: Done
    • Major
    • 2.1.20.Final, 3.0.0.Alpha1
    • None
    • None
    • None

    Description

      The test methods in`SocketHandlerTests` are using same port. Sometimes the operating system does not release the port fast enough. Then another test method cannot reuse the port and ends with `java.net.BindException: Address already in use` exception.

      This happens especially on heavy loaded system.

      The `SimpleServer` implements `AutoCloseable` interface and in `close` method is used `service.awaitTermination(30, TimeUnit.SECONDS);`. So at the end of try with resource where is created `SimpleServer` java should wait 30 seconds until the operating system release used port. But when the operating system is heavy load then it return to java the port was successfully released but it didn't happened yet. It will happened few millisecond later. But In that time is started new test which try use used port and ends with exception.

      Attachments

        Activity

          People

            rhn-support-kstekovi Krystof Stekovic
            rhn-support-kstekovi Krystof Stekovic
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: