Flat file storage race condition #4398
Labels
bug
An issue that needs to be fixed. Alternatively, a PR fixing an issue.
completed
The issue has been fully resolved and the change will be in the next Skript update.
priority: low
Issues that are not harmful to the experience but are related to useful changes or additions.
variables
Related to variables and/or storing them.
Skript/Server Version
Bug Description
Creating multiple Flat File databases leads to race condition when they try to save variables. When there are thousands (or even millions) of variables to save, for different databases, multiple threads try to access the same file called variables.csv.temp. This leads to random data being saved into different databases. While the server is online, all Flat Storage Files will have random data from the other databases. After the server shutdown, all data in files become normal. This also produces errors in console (pasted further in report).
Expected Behavior
Each Flat File Storage creates its own temp variables file and uses this file to write variables to the database.
Probably, just change
"variables.csv.temp"
toname + ".csv.temp"
?Steps to Reproduce
Errors or Screenshots
Other
No response
Agreement
The text was updated successfully, but these errors were encountered: