[
https://issues.apache.org/jira/browse/FTPSERVER-197?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Niklas Gustavsson closed FTPSERVER-197.
---------------------------------------
Resolution: Fixed
Fix Version/s: 1.0-M4
Assignee: Niklas Gustavsson
Added a simple test case and a fix. Thanks for reporting this one, one of the
worse bugs we've had I think.
commit -m "Fix for bug where already started listeners would not be stopped if
FtpServer.start() fails later (FTPSERVER-197)"
/media/big/home/svn/apache/ftpserver-trunk/core/src/main/java/org/apache/ftpserver/impl/DefaultFtpServer.java
/media/big/home/svn/apache/ftpserver-trunk/core/src/main/java/org/apache/ftpserver/listener/nio/NioListener.java
/media/big/home/svn/apache/ftpserver-trunk/core/src/test/java/org/apache/ftpserver/impl/DefaultFtpServerTest.java
Sending
/media/big/home/svn/apache/ftpserver-trunk/core/src/main/java/org/apache/ftpserver/impl/DefaultFtpServer.java
Sending
/media/big/home/svn/apache/ftpserver-trunk/core/src/main/java/org/apache/ftpserver/listener/nio/NioListener.java
Adding
/media/big/home/svn/apache/ftpserver-trunk/core/src/test/java/org/apache/ftpserver/impl/DefaultFtpServerTest.java
Transmitting file data ...
Committed revision 705921.
> start() and stop() methods in FtpServer class can fail to unbind ports.
> ------------------------------------------------------------------------
>
> Key: FTPSERVER-197
> URL: https://issues.apache.org/jira/browse/FTPSERVER-197
> Project: FtpServer
> Issue Type: Bug
> Affects Versions: 1.0-M1, 1.0-M2, 1.0-M3
> Reporter: David Latorre
> Assignee: Niklas Gustavsson
> Fix For: 1.0-M4
>
>
> *start() method in FtpServer class tries to start() all the listeners one by
> one and it sets started=true if all of them succeeded.
> If one of the listeners throws an exception when starting but some others
> succeded , it will not close the open listeners. Calling stop() won't have
> any effect in this case as 'started' is false.
> *stop() method in FtpServer class returns normally when e.g., there are
> open connections to the FtpServer but the server is not really stopped.
> Calling stop() again later won't have any effect as 'started' is false.
> I'm quite concerned about the fact that calling stop() won't stop the server
> since this means that when I undeploy my webapplication the port is still
> open and I need to restart the whole application server in order to have this
> port available (and prevent memory leaks!, I guess).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.