Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-13926

Starting and stopping quickly on Windows results in "port already in use" error

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Low
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: Packaging
    • Labels:
    • Environment:

      Windows

    • Severity:
      Low

      Description

      If I stop/start Cassandra within a minute on Windows, using the included Powershell script it can fail to start with the error message "Found a port already in use. Aborting startup."

      This is because the Powershell script uses netstat to find ports are in use, and even if Cassandra is stopped it is still listed for a short time (reported as TIME_WAIT). See https://superuser.com/questions/173535/what-are-close-wait-and-time-wait-states

      A change to the Powershell script to ensure that only ESTABLISHED ports are searched solves the problem for me and involves changing from:

       if ($line -match "TCP" -and $line -match $portRegex)

      to

       if ($line -match "TCP" -and $line -match $portRegex -and $line -match "ESTABLISHED")

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              rustyparts Jason Rust
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: