-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
plugin-ext: Change PluginsKeyValueStorage
to not continuously access the disk
#12236
Commits on May 1, 2023
-
[plugin-ext] Add file locking to avoid race condition writing to glob…
…al plugin storage file Fixes #8384 Added the use of a semaphore to lock access to the global plugin storage file, to avoid it being accessed in a disorderly fashion, causing potential corruption. As per the issue discussion, it's possible that there is also a potential race condition caused by node's write function, not flushing its buffers to disk, but in this specific case, it was obvious that parallel calls to set() and get() were the main cause of the problems. Signed-off-by: Marc Dumais <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 41eecc4 - Browse repository at this point
Copy the full SHA 41eecc4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4092d0c - Browse repository at this point
Copy the full SHA 4092d0cView commit details -
Inversify 4 doesn't really support async postConstruct methods.
Configuration menu - View commit details
-
Copy full SHA for ee6bf49 - Browse repository at this point
Copy the full SHA ee6bf49View commit details -
make
globalStateFileLock
process-globalAlso put a guard around the folder initialization before writing to the `global-state.json` file.
Configuration menu - View commit details
-
Copy full SHA for 816dcae - Browse repository at this point
Copy the full SHA 816dcaeView commit details -
handle guarding access to various files
Turns out the `PluginsKeyValueStorage` implementation handles more than just the one `global-state.json` file, so we need to make sure to guard against concurrent access to these files too.
Configuration menu - View commit details
-
Copy full SHA for 3ba222a - Browse repository at this point
Copy the full SHA 3ba222aView commit details -
Configuration menu - View commit details
-
Copy full SHA for ea2b16d - Browse repository at this point
Copy the full SHA ea2b16dView commit details -
Configuration menu - View commit details
-
Copy full SHA for cb0cd71 - Browse repository at this point
Copy the full SHA cb0cd71View commit details -
[plugins-key-value-storage] add minimal tests
Signed-off-by: Marc Dumais <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 485c444 - Browse repository at this point
Copy the full SHA 485c444View commit details -
core: introduce
FileSystemLocking
The native Node file system APIs are powerful but low level: Nothing prevents bad code from concurrently writing to the same file. `FileSystemLocking` is meant to be a central component for any method handling files and wanting to prevent concurrent access by other parts of the framework.
Configuration menu - View commit details
-
Copy full SHA for 7a7eaee - Browse repository at this point
Copy the full SHA 7a7eaeeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 857e1c3 - Browse repository at this point
Copy the full SHA 857e1c3View commit details -
Configuration menu - View commit details
-
Copy full SHA for e2e46df - Browse repository at this point
Copy the full SHA e2e46dfView commit details -
Instead of reading/writing on each get/set, use an in-memory cache and synchronize the data on disk every so often.
Configuration menu - View commit details
-
Copy full SHA for 8e1686c - Browse repository at this point
Copy the full SHA 8e1686cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 66680ae - Browse repository at this point
Copy the full SHA 66680aeView commit details -
Configuration menu - View commit details
-
Copy full SHA for ca2e324 - Browse repository at this point
Copy the full SHA ca2e324View commit details -
Configuration menu - View commit details
-
Copy full SHA for 655a942 - Browse repository at this point
Copy the full SHA 655a942View commit details -
Configuration menu - View commit details
-
Copy full SHA for e8dfd42 - Browse repository at this point
Copy the full SHA e8dfd42View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4675ccb - Browse repository at this point
Copy the full SHA 4675ccbView commit details