Skip to content
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 local-storage problem about file-locking #3760

Open
joebnb opened this issue Apr 23, 2023 · 0 comments
Open

plugin local-storage problem about file-locking #3760

joebnb opened this issue Apr 23, 2023 · 0 comments

Comments

@joebnb
Copy link

joebnb commented Apr 23, 2023

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.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant