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

Try to prevent a deadlock when writing options #15666

Merged
merged 6 commits into from Mar 5, 2020
Merged

Try to prevent a deadlock when writing options #15666

merged 6 commits into from Mar 5, 2020

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Mar 5, 2020

refs #15545 (comment)

Invalidator tests passed for me locally. Not sure I missed something maybe?

@tsteur tsteur added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Needs Review PRs that need a code review labels Mar 5, 2020
@tsteur tsteur added this to the 3.13.4 milestone Mar 5, 2020
@@ -78,11 +78,12 @@ public function getAllRememberToInvalidateArchivedReportsLater()
// we do not really have to get the value first. we could simply always try to call set() and it would update or
// insert the record if needed but we do not want to lock the table (especially since there are still some
// MyISAM installations)
$values = Option::getLike($this->rememberArchivedReportIdStart . '%');
$values = Option::getLike('%' . $this->rememberArchivedReportIdStart . '%');
Copy link
Member

Choose a reason for hiding this comment

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

Sometimes I see '%_' . and other times '%' ., could that be an issue?

Copy link
Member Author

Choose a reason for hiding this comment

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

@diosmosis not really. I just copied behaviour what was done on the right part, to have the same on the left. It'll not make a difference though

@diosmosis
Copy link
Member

I don't see a change to the Option::getLike() in deleteOptionLike(), should there be one?

@tsteur
Copy link
Member Author

tsteur commented Mar 5, 2020

@diosmosis yes there should! Will add it now. I used to have it there but must have been undone by some other reverts

@tsteur
Copy link
Member Author

tsteur commented Mar 5, 2020

@diosmosis actually it works because it is already partially sent with the % when the method is called. I will make that more clear. It's confusing right now

@diosmosis
Copy link
Member

looks good to merge if tests pass 👍

@tsteur tsteur merged commit 6a3fc7d into 3.x-dev Mar 5, 2020
@tsteur tsteur deleted the 15545_4 branch March 5, 2020 03:40
jonasgrilleres pushed a commit to 1024pix/pix-analytics that referenced this pull request Sep 22, 2020
jbuget pushed a commit to 1024pix/pix-analytics that referenced this pull request Sep 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants