garydgregory 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-487550096
 
 
   Hi All:
   
   Back to https://github.com/apache/commons-vfs/pull/36#issuecomment-487393002:
   
   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?
   

----------------------------------------------------------------
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