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")