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

put rexpiring delay logic in Lock class #15874

Merged
merged 5 commits into from Apr 29, 2020
Merged

Conversation

diosmosis
Copy link
Member

Fixes #15870

@diosmosis diosmosis 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 Apr 28, 2020
@diosmosis diosmosis added this to the 3.13.6 milestone Apr 28, 2020
@tsteur
Copy link
Member

tsteur commented Apr 28, 2020

looks good if tests pass @diosmosis I haven't done a full test but debugged and looks good. It was applying the correct TTL and basically the lock instance now persists the time across individual archives as the instance is created when the archives starts and added to the stack.

It seems when browser archiving is enabled, it may not 100% work though. In my case it was creating the lock eg every time for each metric
image

I reckon this impacts only browser archiving though (haven't tested cron archiving). Maybe you could quickly double check it only creates the lock once per cron archive?

@tsteur
Copy link
Member

tsteur commented Apr 28, 2020

Actually, I think it might have been because I had archiving forced (always_archive_data_day=1) so all good

@diosmosis
Copy link
Member Author

@tsteur I can confirm it doesn't get called in core:archive for me, but for it to get called, the archiving job would have to run for a long time (even if I set the timeout to 30s, it would have to run for more than my local jobs run for).

/**
* @var \Piwik\Tracker\Db|\Piwik\Db\AdapterInterface|\Piwik\Db
*/
private $readerDb;
Copy link
Member

Choose a reason for hiding this comment

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

btw @diosmosis I suppose this one isn't needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

removed it

@tsteur
Copy link
Member

tsteur commented Apr 28, 2020

@diosmosis sorry seems one test is now failing: https://travis-ci.org/github/matomo-org/matomo/jobs/680785282#L923

Not sure if the value is expected? Feel free to merge once the test is fixed.

@diosmosis diosmosis merged commit 1d58224 into 3.x-dev Apr 29, 2020
@diosmosis diosmosis deleted the 15870-only-one-db-adapter branch April 29, 2020 01:17
jonasgrilleres pushed a commit to 1024pix/pix-analytics that referenced this pull request Sep 22, 2020
* Only use one reader db instance per LogAggregator.

* use re-expire logic in Lock itself

* tweak

* Remove unneeded var

* fix test
jbuget pushed a commit to 1024pix/pix-analytics that referenced this pull request Sep 26, 2020
* Only use one reader db instance per LogAggregator.

* use re-expire logic in Lock itself

* tweak

* Remove unneeded var

* fix test
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