Bug 833292 - MemoryError in Tasks.do_search
MemoryError in Tasks.do_search
Status: CLOSED DUPLICATE of bug 835179
Product: Beaker
Classification: Community
Component: web UI (Show other bugs)
0.8
Unspecified Unspecified
unspecified Severity unspecified (vote)
: ---
: ---
Assigned To: Dan Callaghan
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-19 03:24 EDT by Dan Callaghan
Modified: 2014-08-12 00:34 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-08-01 23:46:09 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Dan Callaghan 2012-06-19 03:24:53 EDT
2012-06-18 18:05:29,609 cherrypy.msg INFO HTTP: Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/CherryPy-2.3.0-py2.6.egg/cherrypy/_cphttptools.py", line 121, in _run
    self.main()
  File "/usr/lib/python2.6/site-packages/CherryPy-2.3.0-py2.6.egg/cherrypy/_cphttptools.py", line 264, in main
    body = page_handler(*virtual_path, **self.params)
  File "<string>", line 3, in do_search
  File "/usr/lib/python2.6/site-packages/turbogears/controllers.py", line 361, in expose
    *args, **kw)
  File "<generated code>", line 0, in run_with_transaction
  File "/usr/lib/python2.6/site-packages/peak/rules/core.py", line 153, in __call__
    return self.body(*args, **kw)
  File "/usr/lib/python2.6/site-packages/turbogears/database.py", line 458, in sa_rwt
    retval = func(*args, **kw)
  File "/usr/lib/python2.6/site-packages/turbogears/controllers.py", line 244, in _expose
    @abstract()
  File "<generated code>", line 0, in _expose
  File "/usr/lib/python2.6/site-packages/peak/rules/core.py", line 153, in __call__
    return self.body(*args, **kw)
  File "/usr/lib/python2.6/site-packages/turbogears/controllers.py", line 390, in <lambda>
    fragment, options, args, kw)))
  File "/usr/lib/python2.6/site-packages/turbogears/controllers.py", line 425, in _execute_func
    output = errorhandling.try_call(func, *args, **kw)
  File "/usr/lib/python2.6/site-packages/turbogears/errorhandling.py", line 77, in try_call
    return func(self, *args, **kw)
  File "<string>", line 3, in do_search
  File "/usr/lib/python2.6/site-packages/turbogears/controllers.py", line 207, in validate
    return errorhandling.run_with_errors(errors, func, *args, **kw)
  File "/usr/lib/python2.6/site-packages/turbogears/errorhandling.py", line 118, in run_with_errors
    return func(self, *args, **kw)
  File "<string>", line 3, in do_search
  File "/usr/lib/python2.6/site-packages/turbogears/paginate.py", line 268, in decorated
    output[var_name] = var_data[offset:endpoint]
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/query.py", line 1560, in __getitem__
    return list(res)
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/query.py", line 1721, in __iter__
    return self._execute_and_instances(context)
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/query.py", line 1726, in _execute_and_instances
    mapper=self._mapper_zero_or_none())
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/session.py", line 724, in execute
    clause, params or {})
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 1191, in execute
    params)
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 1271, in _execute_clauseelement
    return self.__execute_context(context)
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 1302, in __execute_context
    context.parameters[0], context=context)
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 1394, in _cursor_execute
    context)
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/default.py", line 299, in do_execute
    cursor.execute(statement, parameters)
  File "/usr/lib64/python2.6/site-packages/MySQLdb/cursors.py", line 173, in execute
    self.errorhandler(self, exc, value)
  File "/usr/lib64/python2.6/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
MemoryError: <bound method Tasks.do_search of <bkr.server.tasks.Tasks object at 0x7f6a6a236910>>

Caused by the AJAX tasks widget on the recipe page (which fetches /tasks/do_search).
Comment 2 Dan Callaghan 2012-06-19 03:27:49 EDT
I haven't reproduced this locally yet, but presumably it is due to the eager loading introduced for bug 751330 which results in this ugliness when fetching tasks for a recipe:

SELECT anon_1.recipe_task_id AS anon_1_recipe_task_id, anon_1.recipe_task_recipe_id AS anon_1_recipe_task_recipe_id, anon_1.recipe_task_task_id AS anon_1_recipe_task_task_id, anon_1.recipe_task_start_time AS anon_1_recipe_task_start_time, anon_1.recipe_task_finish_time AS anon_1_recipe_task_finish_time, anon_1.recipe_task_result AS anon_1_recipe_task_result, anon_1.recipe_task_status AS anon_1_recipe_task_status, anon_1.recipe_task_role AS anon_1_recipe_task_role, task_1.id AS task_1_id, task_1.name AS task_1_name, task_1.rpm AS task_1_rpm, task_1.oldrpm AS task_1_oldrpm, task_1.path AS task_1_path, task_1.description AS task_1_description, task_1.repo AS task_1_repo, task_1.avg_time AS task_1_avg_time, task_1.destructive AS task_1_destructive, task_1.nda AS task_1_nda, task_1.creation_date AS task_1_creation_date, task_1.update_date AS task_1_update_date, task_1.uploader_id AS task_1_uploader_id, task_1.owner AS task_1_owner, task_1.version AS task_1_version, task_1.license AS task_1_license, task_1.priority AS task_1_priority, task_1.valid AS task_1_valid, log_recipe_task_1.id AS log_recipe_task_1_id, log_recipe_task_1.recipe_task_id AS log_recipe_task_1_recipe_task_id, log_recipe_task_1.path AS log_recipe_task_1_path, log_recipe_task_1.filename AS log_recipe_task_1_filename, log_recipe_task_1.start_time AS log_recipe_task_1_start_time, log_recipe_task_1.server AS log_recipe_task_1_server, log_recipe_task_1.basepath AS log_recipe_task_1_basepath, log_recipe_task_result_1.id AS log_recipe_task_result_1_id, log_recipe_task_result_1.recipe_task_result_id AS log_recipe_task_result_1_recipe_task_result_id, log_recipe_task_result_1.path AS log_recipe_task_result_1_path, log_recipe_task_result_1.filename AS log_recipe_task_result_1_filename, log_recipe_task_result_1.start_time AS log_recipe_task_result_1_start_time, log_recipe_task_result_1.server AS log_recipe_task_result_1_server, log_recipe_task_result_1.basepath AS log_recipe_task_result_1_basepath, recipe_task_result_1.id AS recipe_task_result_1_id, recipe_task_result_1.recipe_task_id AS recipe_task_result_1_recipe_task_id, recipe_task_result_1.path AS recipe_task_result_1_path, recipe_task_result_1.result AS recipe_task_result_1_result, recipe_task_result_1.score AS recipe_task_result_1_score, recipe_task_result_1.log AS recipe_task_result_1_log, recipe_task_result_1.start_time AS recipe_task_result_1_start_time 
FROM (SELECT recipe_task.id AS recipe_task_id, recipe_task.recipe_id AS recipe_task_recipe_id, recipe_task.task_id AS recipe_task_task_id, recipe_task.start_time AS recipe_task_start_time, recipe_task.finish_time AS recipe_task_finish_time, recipe_task.result AS recipe_task_result, recipe_task.status AS recipe_task_status, recipe_task.role AS recipe_task_role 
FROM recipe_task INNER JOIN recipe ON recipe.id = recipe_task.recipe_id INNER JOIN recipe_set ON recipe_set.id = recipe.recipe_set_id INNER JOIN job ON job.id = recipe_set.job_id 
WHERE job.to_delete IS NULL AND job.deleted IS NULL AND recipe.id = %s ORDER BY recipe_task.id ASC 
 LIMIT 0, 1) AS anon_1 LEFT OUTER JOIN task AS task_1 ON task_1.id = anon_1.recipe_task_task_id LEFT OUTER JOIN log_recipe_task AS log_recipe_task_1 ON anon_1.recipe_task_id = log_recipe_task_1.recipe_task_id LEFT OUTER JOIN recipe_task_result AS recipe_task_result_1 ON anon_1.recipe_task_id = recipe_task_result_1.recipe_task_id LEFT OUTER JOIN log_recipe_task_result AS log_recipe_task_result_1 ON recipe_task_result_1.id = log_recipe_task_result_1.recipe_task_result_id ORDER BY anon_1.recipe_task_id ASC
Comment 3 Raymond Mancy 2012-08-01 06:10:37 EDT
I think this and 835179 are caused by the same change.

*** This bug has been marked as a duplicate of bug 835179 ***
Comment 4 Raymond Mancy 2012-08-01 07:58:44 EDT
Perhaps that was a bit hurried, I'm not convinced yet.
Comment 5 Dan Callaghan 2012-08-01 23:46:09 EDT
Confirmed that this is indeed the very same issue as bug 835179.

*** This bug has been marked as a duplicate of bug 835179 ***

Note You need to log in before you can comment on or make changes to this bug.