[
https://issues.apache.org/jira/browse/CASSANDRA-13926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16189853#comment-16189853
]
Jason Rust commented on CASSANDRA-13926:
----------------------------------------
I think that could work for our use-case. I'm happy to close the issue if
others agree and have concerns about how solid the fix I posted is.
> 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
> Labels: windows
>
> 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: [email protected]
For additional commands, e-mail: [email protected]