View Issue Details

IDProjectCategoryView StatusLast Update
16483Bug reportsConditionspublic2020-08-03 12:54
Reporterjenseeckhout Assigned Tocdorin  
PrioritynoneSeveritycrash 
Status confirmedResolutionopen 
Product Version4.2.5 
Summary16483: 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.

Tagsconditions
Complete LimeSurvey version number (& build)4.2.5
I will donate to the project if issue is resolvedNo
Browser
Database & DB-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

Activities

gLf

gLf

2020-07-29 16:20

reporter   ~59158

Same behaviour on 4.2.2+200504
condition/scenario is set, but with timeout/crash

Issue History

Date Modified Username Field Change
2020-07-10 13:22 jenseeckhout New Issue
2020-07-29 16:19 gLf Tag Attached: conditions
2020-07-29 16:20 gLf Note Added: 59158
2020-07-29 23:02 cdorin Assigned To => cdorin
2020-07-29 23:02 cdorin Status new => confirmed