Skip to content

lock-memory - won't fail if lock already exists #194

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

Closed
AuHau opened this issue Mar 28, 2019 · 2 comments
Closed

lock-memory - won't fail if lock already exists #194

AuHau opened this issue Mar 28, 2019 · 2 comments
Labels
exp/novice Someone with a little familiarity can pick up help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws) P3 Low: Not priority right now status/ready Ready to be worked

Comments

@AuHau
Copy link
Member

AuHau commented Mar 28, 2019

While working on the repo migration tool, I have noticed that the implementation of in-memory lock in lock-memory.js behaves in bit weird way as it will acquire lock even if there is already lock in place.
It exposes function locked(), yet I have not found it used anywhere. But even then I think the correct behavior of any locking functionality should be to fail when there is a lock already present.

I understand that in browser there might not be really concurrent processes, so I am just wondering if that was a design decision or is it a bug?

@jacobheun
Copy link
Contributor

I think this is a bug, it should really fail if it already exists. While the use case of that actually being the case should be low, it should still protect against acquiring an already existing lock.

@jacobheun jacobheun added kind/bug A bug in existing code (including security flaws) help wanted Seeking public contribution on this issue exp/novice Someone with a little familiarity can pick up status/ready Ready to be worked P3 Low: Not priority right now labels Mar 29, 2019
@AuHau
Copy link
Member Author

AuHau commented Aug 7, 2019

Solved by #200

@AuHau AuHau closed this as completed Aug 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exp/novice Someone with a little familiarity can pick up help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws) P3 Low: Not priority right now status/ready Ready to be worked
Projects
None yet
Development

No branches or pull requests

2 participants