plugin local-storage problem about file-locking
Your Environment
- verdaccio version: 5.19.1
- node version [12.x.x, 14.x.x]:16
- package manager: npm@8
- os: ubuntu
- platform: npm + pm2 cluster mode
Describe the bug
hi , juanpicado:
recently i meet a problem in verdaccio,i‘m consider it's my problem,but i need your big picture advice as designer.and I also hope that this issues can also help verdaccio future development.
i'm runing verdaccio in a ECS (8u16g), for maximum performance of each cpu core,i use PM2 to cluster mode running 8 child process,and meet resource racing problem about .verdaccio_db.json
at startup cause the local-storage file locking it may cause DB locked and return empty,and it will generate a new secret.it will cause some instance can't recognize legal user, some works as expected.
after startup, the loacl-storage will write db when in memory dbList increase ,here also will happen file lock problem,in concurrent case also will happen different process will write .verdaccio_db.json
my question is:did i use verdaccio wrong?is it only can be work with one thread not multiple, and in one thread it also has good performace on serve. is there a good way to solve file locking or decrease occur frequency
--------update maybe use a queue https://www.npmjs.com/package/qlobber-fsq or https://www.npmjs.com/package/graceful-fs will have some help.

Source: verdaccio/verdaccio