This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 225290

Summary: Exceptions in sftp support with "4:" message
Product: cnd Reporter: Andrew Krasny <akrasny>
Component: RemoteAssignee: issues@cnd <issues>
Status: RESOLVED FIXED    
Severity: normal CC: exceptions_reporter
Priority: P3    
Version: 7.4   
Hardware: All   
OS: Solaris   
Issue Type: DEFECT Exception Reporter:

Description Andrew Krasny 2013-01-24 14:28:19 UTC
We've seen these exceptions several times before (see http://netbeans.org/bugzilla/show_bug.cgi?id=212961, http://netbeans.org/bugzilla/show_bug.cgi?id=212962)

I was able to reproduce this exception in the current code. 
It looks like the problem is well-reproducible on slow connections when we are trying to list a directory content and create some sub-directory simultaneously from 2 threads.

Further experiments showed that things could be improved by avoiding re-using of sftp channels from different threads(?).

Though it is allowable (and seems to be a right thing to issue several sequent commands on the same ChannelSftp (like 'cd', 'chmod', 'put'), it is better not to cache channels and close them as soon as one logical tasks sequence is done.
Comment 1 Andrew Krasny 2013-01-24 14:43:39 UTC
The fix is not to use caching.
http://hg.netbeans.org/cnd-main/rev/9f56c1a6d967
Comment 2 Quality Engineering 2013-01-25 03:02:51 UTC
Integrated into 'main-golden', will be available in build *201301250001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/9f56c1a6d967
User: Andrew Krasny <akrasny@netbeans.org>
Log: Bug #225290 - Exceptions in sftp support with "4:" message

Do not cache sftp channels in SFTSupport. This has no forformance effect, and only increases a risk of exceptions...
Comment 3 Quality Engineering 2013-01-29 03:29:11 UTC
Integrated into 'main-golden', will be available in build *201301290001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/723c79bc3ed8
User: Maria Tishkova <mromashova@netbeans.org>
Log: Bug #225290 - Exceptions in sftp support with 4: message [reverting previous changes as they causes significant slow-down]
Comment 4 Maria Tishkova 2013-05-20 09:26:24 UTC
*** Bug 227720 has been marked as a duplicate of this bug. ***