commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tomas Mysik (JIRA)" <>
Subject [jira] [Commented] (NET-419) Not possible to call FTPClient.abort() method correctly
Date Mon, 05 Sep 2011 07:35:09 GMT


Tomas Mysik commented on NET-419:

> No need to ping us. We see your message. We may not reply immediately, but your issue
is still open.

Sorry, I did it since the issue is still unassigned (in NetBeans, this means that the issue
is not yet evaluated).

> The problem is [...]

Yes, exactly as I wrote it in my initial description. That's the reason why I have reported
this issue and I'm glad that I'm not the only one who doesn't know how to use this method

> you can call abort() at any time (and mostly it will work)

Unfortunately, this is likely not acceptable for us, I'm afraid. In such case, sooner or later
I would get a bug report and I won't be able to fix it so I prefer not to provide this functionality
at all.

> This needs a re-think of what should be done.

I don't know your code but have seen that you are able to keep-alive during file transfer
via repeatedly sending NOOP command after reading some chunk of data, right? As a quick, not-so-great
fix - what about to add a volatile [1] boolean field transferAborted and check this field
during file transfer as well?

Thanks a lot.
[1] Yes, I know that "sudden" use of volatile in not thread-safe code can be confusing; but,
with a proper comment (with reference to this bug perhaps) added to such field, I think that
it would be acceptable.

> Not possible to call FTPClient.abort() method correctly
> -------------------------------------------------------
>                 Key: NET-419
>                 URL:
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 3.0
>         Environment: java version "1.6.0_26"
> Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
> Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)
> Linux cattie 2.6.38-10-generic #46-Ubuntu SMP Tue Jun 28 15:07:17 UTC 2011 x86_64 x86_64
x86_64 GNU/Linux
>            Reporter: Tomas Mysik
> Unfortunately, it seems that there are difficulties of using FTPClient.abort()
> method [1][2]. Also, it is really not clear how the abort() method should be
> called/used at all - if from another thread (as I would expect) then there is a problem
> thread-safety: FTPClient itself is not thread-safe so it means that some
> custom lock/monitor must be used; but this lock will prevent calling abort() on
> the FTPClient while it is downloading/uploading file since file upload/download
> itself is blocking...
> If I'm wrong and the abort() method works then an example in Javadoc would be more than
> Thanks a lot.
> [1]
> [2]

This message is automatically generated by JIRA.
For more information on JIRA, see:


View raw message