MaxKellermann commented on pull request #155:
URL: https://github.com/apache/commons-vfs/pull/155#issuecomment-796734600


   @garydgregory this isn't about thread-safety as in "concurrent use"; this 
(old, now-revealed) bug is about "create a stream in one thread and close it in 
another (but no concurrent use)".
   The bug has always been there and affects *all* providers - more exactly: 
all providers which use `AbstractFileObject` as base class (which is: all of 
them, isn't it?).
   
   Previously, the bug led to problems which were mostly invisible; i.e. the 
`FileContentThreadData` silently leaked objects. Now it's a crash 
(`NullPointerException`).
   
   As I said, the `NullPointerException` can be made go away easily by adding a 
`null` check, but the underlying bug will still be there.
   
   However, if you decide that commons-vfs is not thread-safe as in "stream 
objects must not be passed across thread boundaries", we don't need to do 
anything. Then the crash @boris-petrov faces is a bug in his own code, a wrong 
use of the commons-vfs API.
   
   Before anybody can attempt to fix this, an authority for commons-vfs must 
decide what is an allowed use of the API. If there are restrictions on passing 
objects across thread boundaries, those should be documented. Only after this 
documentation exists, we can come up with a solution.


----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to