boris-petrov commented on issue #36: fix for VFS-662: SftpFileSystem has 
Thread-safe issue about idleChannel
URL: https://github.com/apache/commons-vfs/pull/36#issuecomment-487551862
 
 
   > The `session` ivar is not final and gets written in the private method 
`ensureSession()`, so it is possible for it to get initialized multiple times 
in a race-condition. The method `getChannel()` can end up writing to both 
`session` and `idleChanne`, so both values need to be published to other 
threads. The simplest way to do this is to synchronize the `getChannel()` 
method.
   > 
   > Thoughts?
   
   Well, in that case there is still a race-condition because of the 
`executeCommand` method which also calls `ensureSession` so I guess it also 
should be `synchronized`...?
   
   > I do not see anything in that PR about concurrency. That PR just fiddles 
with POMs. What am I missing?
   
   This PR has nothing to do with concurrency but as I said @abashev's fork of 
VFS has some fixes in it which he wants to merge - and this PR is just the 
first one of a few to come as far as I understand.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to