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

Minion.unlock() concurrency #90

Closed
andrii-suse opened this issue Dec 16, 2019 · 4 comments
Closed

Minion.unlock() concurrency #90

andrii-suse opened this issue Dec 16, 2019 · 4 comments

Comments

@andrii-suse
Copy link

  • Minion version: perl-Minion-10.0-1.2.noarch
  • Perl version: 5.30.1, all in travis
  • Operating system: opensuse:tumbleweed:20190925, travis environment

Steps to reproduce the behavior

Run test case https://github.com/andrii-suse/minion/blob/stress_lock/t/pg_minion_lock_stress.t , e.g. :
n=0; while : $((++n)); do echo $n; PERL5LIB=lib perl t/pg_minion_lock_stress.t || break; done

Expected behavior

Consistent results

Actual behavior

Test fails in ~50% cases indicating that Minion locks are not removed properly. (see test.log)
Suspected concurrency problems at

'delete from minion_locks where id = (

test.log

In contrast to local environment, the test in travis is always failing https://travis-ci.org/andrii-suse/minion/builds/625632738

@kraih
Copy link
Member

kraih commented Dec 16, 2019

Can you replicate the problem without using 3rd party modules?

@andrii-suse
Copy link
Author

andrii-suse commented Dec 16, 2019

Can you replicate the problem without using 3rd party modules?

I can try if you are really sure that mentioned DELETE command cannot try to delete the same row for concurrent queries.
At the same time adding 'for update' into the query andrii-suse@770c173 fixes problem for me and in travis, so I don't think that additional test cases are needed https://travis-ci.org/andrii-suse/minion/builds/625642901

@kraih
Copy link
Member

kraih commented Dec 16, 2019

Agreed, there should be a for update.

@kraih kraih closed this as completed in a9a00ff Dec 16, 2019
@kraih
Copy link
Member

kraih commented Dec 20, 2019

I forgot to credit you for the patch, sorry about that. 837f916...d82cf78

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

2 participants