Description
Description
In file https://github.com/Talend/components/blob/master/components/components-fileio/s3-runtime-di/src/main/java/org/talend/components/s3/runtime/S3OutputWriter.java, the temporary file name is a constant ("data.csv"):
// prepare the local target, will upload it to s3 and clear it in the close method String tmpDir = System.getProperty("java.io.tmpdir"); data_file = new File(tmpDir, "data.csv"); data_file.deleteOnExit(); OutputStream outputStream = new FileOutputStream(data_file); writer = new CsvWriter(new OutputStreamWriter(outputStream), ';');
This is fine (although arguable) when running in a job but when component is executed inside a TCOMP server, it leads to potential concurrent issues: one request may delete the temporary file of an other ("data_file" is deleted in close() method).
Proposal
Use java.io.File#createTempFile(java.lang.String, java.lang.String) iso. constant file name.