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

New INI setting live_query_max_execution_time to allow configuration of max execution time #14858

Merged
merged 5 commits into from Sep 11, 2019

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Sep 4, 2019

cc @mattab

Users can now optionally configure a max_execution_time for live queries to prevent a live query from running for a very long time eg when looking at a year with a segment that doesn't find any visitors.

Added as many tests as I could. Noticed the MySQL version on Travis doesn't support this feature yet otherwise could have tested it there further.

@tsteur tsteur added the Needs Review PRs that need a code review label Sep 4, 2019
@tsteur tsteur added this to the 3.12.0 milestone Sep 4, 2019
throw $e;
}
return $visits;
}
Copy link
Member

Choose a reason for hiding this comment

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

This code seems important. Would it be possible to unit/integration test this code w/ a mock Db object returned by Db::getReader()?

@Findus23
Copy link
Member

Unfortunately this syntax isn't supported in MariaDB which has another synax to set the maximum execution time for a query:
https://mariadb.com/kb/en/library/aborting-statements/

@tsteur
Copy link
Member Author

tsteur commented Sep 10, 2019

thanks @Findus23 I will mention in the config that it likely won't work on MariaDB

@tsteur
Copy link
Member Author

tsteur commented Sep 10, 2019

Added some tests @diosmosis

@diosmosis diosmosis merged commit e31ec88 into 3.x-dev Sep 11, 2019
@diosmosis diosmosis deleted the live_max_query_time branch September 11, 2019 07:42
@mattab mattab changed the title Allow configuration of max execution time New INI setting live_query_max_execution_time to allow configuration of max execution time Oct 25, 2019
@mattab mattab added c: Performance For when we could improve the performance / speed of Matomo. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. labels Oct 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Performance For when we could improve the performance / speed of Matomo. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants