Jason Rust created CASSANDRA-13926:
--------------------------------------

             Summary: Starting and stopping quickly on Windows results in "port 
already in use" error
                 Key: CASSANDRA-13926
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-13926
             Project: Cassandra
          Issue Type: Bug
          Components: Packaging
         Environment: Windows
            Reporter: Jason Rust
            Priority: Minor


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:
{code} if ($line -match "TCP" -and $line -match $portRegex){code}
to
{code} if ($line -match "TCP" -and $line -match $portRegex -and $line -match 
"ESTABLISHED"){code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to