jglobus / JGlobus

jGlobus is a collection of Java client libraries for Globus® Toolkit security, GRAM, and GridFTP.
http://www.globus.org/toolkit/jglobus/
Apache License 2.0
24 stars 44 forks source link

fix: when exception are thrown the socket is never closed. #152

Closed romainreuillon closed 9 years ago

romainreuillon commented 9 years ago

When running at scale I got this exception on a regular basis:

1006789 [Thread-787738] ERROR org.globus.ftp.vanilla.FTPServerFacade  - Exception occured in the exception handling code, so it cannot be properly propagated to the user
java.lang.IllegalArgumentException: This socket does not seem to exist in the socket pool.
        at org.globus.ftp.dc.SocketPool.remove(SocketPool.java:78)
        at org.globus.ftp.dc.GridFTPTransferSourceThread.shutdown(GridFTPTransferSourceThread.java:82)
        at org.globus.ftp.dc.TransferSourceThread.run(TransferSourceThread.java:87)

When it happens the underlying socket has not chance of being closed. This PR solves it.