View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
16604Bug reportsConditionspublic2021-03-08 19:36
Reportergabrieljenik Assigned Togabrieljenik  
PrioritynoneSeveritycrash 
Status closedResolutionfixed 
Product Version3.23.0 
Fixed in Version3.25.17 
Summary16604: Adding condition triggers bulk update for complete database
Description

When adding a condition to a question (no matter which type, values or scenario), the complete database is processed, instead of just processing the survey you were working in.
See https://github.com/LimeSurvey/LimeSurvey/blob/master/application/controllers/admin/conditionsaction.php#L767

NULL is passed as a first argument instead of the active survey ID to LimeExpressionManager::UpgradeConditionsToRelevance(null, $qid);
That function reads as follows: * @param integer|null $surveyId - if NULL, processes the entire database, otherwise just the specified survey

This makes it so that every time a condition is added, the complete database is processed. In the case of my client, this is a very large database with many surveys, questions and conditions. This then results in either PHP running out of memory, or the server timing out and throwing an error.

Steps To Reproduce
  1. Have several surveys on a Limesurvey instance, each containing some questions with conditions on them.
  2. Go to one survey and add a condition (does not matter which parameters) to a question.
  3. Observe (the way I monitored is: enable MySQL logging in my.cnf and tail -f query.log in terminal) how every survey is processed
  4. (in my case) Wait for over 2min for the server to either time out, or PHP to run out of memory.
Additional Information

Do note that the condition actually gets added correctly. It is the next action (LimeExpressionManager::UpgradeConditionsToRelevance) that causes the timeout/crash.

TagsNo tags attached.
Bug heat4
Complete LimeSurvey version number (& build)3.23.0
I will donate to the project if issue is resolvedNo
Browser
Database type & versionMySQL 10.3.22 (MariaDB)
Server OS (if known)Ubuntu 20.04 LTS
Webserver software & version (if known)Apache/2.4.41 (Ubuntu)
PHP Version7.2

Relationships

related to 16483 closedgabrieljenik Adding condition triggers bulk update for complete database 

Users monitoring this issue

There are no users monitoring this issue.

Activities

gabrieljenik

gabrieljenik

2020-08-24 21:50

manager   ~59600

PR: https://github.com/LimeSurvey/LimeSurvey/pull/1564

If surveyId is not given but qid is, fetch surveyd from the question

ollehar

ollehar

2021-02-08 17:13

administrator   ~62026

Travis is red for the PR.

gabrieljenik

gabrieljenik

2021-03-01 16:55

manager   ~62586

Fix committed to 3.x-LTS branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=31238

gabrieljenik

gabrieljenik

2021-03-02 16:44

manager   ~62608

PR: https://github.com/LimeSurvey/LimeSurvey/pull/1788/
Code review

gabrieljenik

gabrieljenik

2021-03-02 18:24

manager   ~62617

Fix committed to 3.x-LTS branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=31251

Related Changesets

LimeSurvey: 3.x-LTS c6186724

2021-03-01 16:55:07

gabrieljenik


Committer: GitHub Details Diff
Fixed issue 16604: Adding condition triggers bulk update for complete database (#1564) Affected Issues
16604
mod - application/helpers/expressions/em_manager_helper.php Diff File

LimeSurvey: 3.x-LTS 91945dc2

2021-03-02 18:24:48

gabrieljenik


Committer: GitHub Details Diff
Fixed issue 16604: Adding condition triggers bulk update for complete database (#1788) Affected Issues
16604
mod - application/helpers/expressions/em_manager_helper.php Diff File

Issue History

Date Modified Username Field Change
2020-08-18 21:44 gabrieljenik New Issue
2020-08-18 21:44 gabrieljenik Status new => assigned
2020-08-18 21:44 gabrieljenik Assigned To => gabrieljenik
2020-08-18 21:44 gabrieljenik Issue generated from: 16483
2020-08-18 21:44 gabrieljenik Relationship added related to 16483
2020-08-24 21:50 gabrieljenik Note Added: 59600
2021-02-08 17:13 ollehar Note Added: 62026
2021-02-08 17:13 ollehar Status assigned => feedback
2021-03-01 16:55 gabrieljenik Changeset attached => LimeSurvey 3.x-LTS c6186724
2021-03-01 16:55 gabrieljenik Note Added: 62586
2021-03-01 16:55 gabrieljenik Resolution open => fixed
2021-03-01 16:55 c_schmitz Status feedback => resolved
2021-03-02 16:44 gabrieljenik Note Added: 62608
2021-03-02 18:24 gabrieljenik Changeset attached => LimeSurvey 3.x-LTS 91945dc2
2021-03-02 18:24 gabrieljenik Note Added: 62617
2021-03-08 19:36 c_schmitz Fixed in Version => 3.25.17
2021-03-08 19:36 c_schmitz Status resolved => closed