[
https://issues.apache.org/jira/browse/METAMODEL-89?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14188304#comment-14188304
]
Kasper Sørensen commented on METAMODEL-89:
------------------------------------------
We won't fire you for not meeting any deadline, because we don't have
deadlines, nor employment ;-) Just kidding - the weekend sounds perfect!
> 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)