cffile makeunique filename isn't synchronised

Description

I think there’s a tiny chance under load that makeunique might conflict, if multiple users upload the same filename at the same time, as I think there’s no locking between generating a unique filename and actually writing out to the new unique filename. both could end up with the same destination filename. I guess one of the requests would then fail at createNewFile…

https://github.com/lucee/Lucee/blob/5.3/core/src/main/java/lucee/runtime/tag/FileTag.java#L963

Environment

None

Activity

Show:

Zac Spitzer 13 August 2021 at 23:38

This just happened with getTempFile() too

We should add at least add a retry or use a guid

Pothys - MitrahSoft 13 July 2020 at 07:13

I've checked this ticket. If multiple users doing same thing means, sometimes the error "The process cannot access the file because it is being used by another process" will occur. Ok. Micha will decide about this issue.

Zac Spitzer 6 May 2020 at 10:04

immediately creating an empty file when a unique filename is generated would help, that way the locking could be more localised

Details

Assignee

Reporter

Priority

Labels

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Affects versions

Created 5 May 2020 at 19:44
Updated 13 August 2021 at 23:38

Flag notifications