Michał Mela created METAMODEL-89:
------------------------------------

             Summary: Racing condition in CsvDataContext
                 Key: METAMODEL-89
                 URL: https://issues.apache.org/jira/browse/METAMODEL-89
             Project: Metamodel
          Issue Type: Bug
    Affects Versions: 4.2.0-incubating
            Reporter: Michał Mela


There seems to be a racing condition in the method that creates a temp file for 
CsvDataContexts constructed with an InputStream: 
CsvDataContext.createFileFromInputStream(InputStream inputStream, String 
encoding) 

For example, if in thread 1 we get to line 243 while in thread 2 we get to line 
240, then, basically, in both threads we have made _sure_ that a file for *the 
same index in both of the threads* doesn't exist. Then both threads will use 
the same filename and one thread will overrride the data for another thread's 
tempfile.
(the file line numbers were based on this listing: 
http://grepcode.com/file/repo1.maven.org/maven2/org.eobjects.metamodel/MetaModel-csv/3.4.11/org/eobjects/metamodel/csv/CsvDataContext.java#CsvDataContext)

The immediate result is that in a thread whose tempfile was overwritten the 
data context will be created based on wrong data.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to