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

lock: added return statement to lock acquire. #120

Merged

Conversation

alejandromumo
Copy link
Member

Copy link
Contributor

@kpsherva kpsherva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! but I am not very experienced with this, better if we have second reviewer

@alejandromumo
Copy link
Member Author

LGTM! but I am not very experienced with this, better if we have second reviewer

The issue here is that moderation's tasks use lock_or_renew (from the lock base implementation), which checks the return value of lock.acquire. Without a return statement, it's always None and fails to execute moderation tasks (e.g. reindex records after approve)

@kpsherva
Copy link
Contributor

kpsherva commented Nov 1, 2023

LGTM! but I am not very experienced with this, better if we have second reviewer

The issue here is that moderation's tasks use lock_or_renew (from the lock base implementation), which checks the return value of lock.acquire. Without a return statement, it's always None and fails to execute moderation tasks (e.g. reindex records after approve)

I understand the change, however I don't know why we are using the lock_or_renew for the moderation actions, this is why I might not be fully aware of the consequences of the change.

@slint
Copy link
Member

slint commented Nov 1, 2023

After discussing IRL with @alejandromumo, I think the overall "behaviour" of the locks is a bit funky right now indeed, but I would separate this into a different issue and just have this PR be an API bug fix.

@kpsherva kpsherva merged commit a76864e into inveniosoftware:master Nov 1, 2023
14 checks passed
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

Successfully merging this pull request may close these issues.

3 participants