Async tasks (cluster deletion, resetting, snapshot generation) sometimes fail

Bug #1549750 reported by Vitaly Kramskikh
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Confirmed
High
Fuel Sustaining
Mitaka
Won't Fix
High
Fuel Python (Deprecated)

Bug Description

Not sure if it affects our normal deployment, it affects at least our UI func tests.

Some examples:

https://ci.fuel-infra.org/job/verify-fuel-web-ui/9080/
https://ci.fuel-infra.org/job/verify-fuel-web-ui/9086/

In app.log from artifacts you can see tracebacks like

(cluster deletion)

Exception in thread EXECUTE_TASKS:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/home/jenkins/workspace/verify-fuel-web-ui/nailgun/nailgun/task/fake.py", line 285, in run
    self.notify(msg)
  File "/home/jenkins/workspace/verify-fuel-web-ui/nailgun/nailgun/task/fake.py", line 202, in notify
    resp_method(**kwargs)
  File "/home/jenkins/workspace/verify-fuel-web-ui/nailgun/nailgun/rpc/receiver.py", line 230, in remove_images_resp
    objects.Task.update(task, {'status': status})
  File "/home/jenkins/workspace/verify-fuel-web-ui/nailgun/nailgun/objects/task.py", line 268, in update
    logger.debug("Updating task: %s", instance.uuid)
AttributeError: 'NoneType' object has no attribute 'uuid'

or

(diagnostic snapshot generation)

2016-02-25 10:10:47.434 ERROR [7fe4eb25e700] (manager) Traceback (most recent call last):
  File "/home/jenkins/workspace/verify-fuel-web-ui/nailgun/nailgun/task/manager.py", line 57, in _call_silently
    to_return = method(task, *args, **kwargs)
  File "/home/jenkins/workspace/verify-fuel-web-ui/nailgun/nailgun/task/task.py", line 1537, in execute
    'settings': conf or cls.conf()
  File "/home/jenkins/workspace/verify-fuel-web-ui/nailgun/nailgun/task/task.py", line 1476, in conf
    editable_attrs = node.cluster.attributes['editable']
AttributeError: 'NoneType' object has no attribute 'attributes'

description: updated
summary: - Cluster deletion sometimes fails
+ Async tasks (cluster deletion, resetting, snapshot generation) sometimes
+ fail
Dmitry Pyzhov (dpyzhov)
tags: added: tech-debt
Revision history for this message
Vladimir Kozhukalov (kozhukalov) wrote :

The root cause of the issue is that having multiple threads and using scoped_session and not correctly synchronizing those threads could lead to database locks and block these threads. In nailgun tests we could mock rpc and check arguments that are used when rpc is called.

When using fake thread for UI tests this mock approach can not be used. Looks like we need to correctly synchronize application threads.

It seems that the fails rate (due to shared database locks) depends on the test node performance. For instance, the same patch could pass tests on openstack-infra while it likely fails when running on slow VM. (there is no enough data to to say this is true, it is just an observation).

Revision history for this message
Roman Vyalov (r0mikiam) wrote :

increase priority to Critical, because: all tests are falling and merge of code was blocked

Changed in fuel:
importance: High → Critical
Revision history for this message
Alexander Kislitsky (akislitsky) wrote :

I see next options to fix:

1. fix failures on shared database locks. they can be introduced by new features or refactoring.
2. remove fake threads.

@Roman, could you please provide links to tests failures. we need more information to find out and fix the issues.

Revision history for this message
Ihor Kalnytskyi (ikalnytskyi) wrote :

@Alex,

It's not an option to remove fake threads. Those failures are about UI integration tests, not about nailgun's one.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to fuel-ui (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/291206

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Related fix proposed to openstack/fuel-ui (mos/mitaka)

Related fix proposed to branch: mos/mitaka
Change author: Vitaly Kramskikh <email address hidden>
Review: https://review.fuel-infra.org/17918

Changed in fuel:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to fuel-ui (master)

Reviewed: https://review.openstack.org/291206
Committed: https://git.openstack.org/cgit/openstack/fuel-ui/commit/?id=4a00826795be919f388d22a387d5aa512801a5cd
Submitter: Jenkins
Branch: master

commit 4a00826795be919f388d22a387d5aa512801a5cd
Author: Vitaly Kramskikh <email address hidden>
Date: Thu Mar 10 17:31:17 2016 +0300

    Avoid cluster deletion when testing Healtcheck tab

    Fake cluster deletion for some reason fails very often due
    to a bug, so it's better to avoid it. It's not needed at all to
    test Healthcheck tab.

    Change-Id: I5a1a010d819b75b7ae8a8be9d9bf9d359c3d191b
    Related-Bug: #1549750

Changed in fuel:
assignee: Fuel Python Team (fuel-python) → Alexander Kislitsky (akislitsky)
Changed in fuel:
status: In Progress → Confirmed
Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Change abandoned on openstack/fuel-ui (mos/mitaka)

Change abandoned by Vitaly Kramskikh <email address hidden> on branch: mos/mitaka
Review: https://review.fuel-infra.org/17918

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on fuel-web (master)

Change abandoned by Alexander Kislitsky (<email address hidden>) on branch: master
Review: https://review.openstack.org/291245
Reason: This cosmetic change is not required

Changed in fuel:
assignee: Alexander Kislitsky (akislitsky) → Fuel Python Team (fuel-python)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to fuel-ui (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/291749

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to fuel-ui (master)

Reviewed: https://review.openstack.org/291749
Committed: https://git.openstack.org/cgit/openstack/fuel-ui/commit/?id=e506310ea0fa065d62b207b73dbc7adab231f48f
Submitter: Jenkins
Branch: master

commit e506310ea0fa065d62b207b73dbc7adab231f48f
Author: Vitaly Kramskikh <email address hidden>
Date: Fri Mar 11 16:56:13 2016 +0300

    Fix random test failures for specific browser/screen combinations

    Related-Bug: #1549750

    Change-Id: Ia1a9060b8d7d490db35f817598b26761e290a3b2

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Change abandoned on openstack/fuel-ui (mos/mitaka)

Change abandoned by Vitaly Kramskikh <email address hidden> on branch: mos/mitaka
Review: https://review.fuel-infra.org/17983

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to fuel-ui (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/292856

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to fuel-ui (master)

Reviewed: https://review.openstack.org/292856
Committed: https://git.openstack.org/cgit/openstack/fuel-ui/commit/?id=102bf656d0c8e64c7b80d9ac76373d0460ce610e
Submitter: Jenkins
Branch: master

commit 102bf656d0c8e64c7b80d9ac76373d0460ce610e
Author: Vitaly Kramskikh <email address hidden>
Date: Tue Mar 15 15:27:46 2016 +0300

    Rewrite UI plugin tests to avoid cluster creation/deletion

    There are 3 consecutive deployment/deletion calls which
    often cause failure on fake environment due to a bug in
    Nailgun. This test case was rewritten to use only 1 deployment
    call.

    Change-Id: Idd43240855d7e6b538b67abec61bd2c0e6d90bab
    Related-Bug: #1549750

Revision history for this message
Bug Checker Bot (esikachev-l) wrote : Autochecker

(This check performed automatically)
Please, make sure that bug description contains the following sections filled in with the appropriate data related to the bug you are describing:

actual result

version

expected result

steps to reproduce

For more detailed information on the contents of each of the listed sections see https://wiki.openstack.org/wiki/Fuel/How_to_contribute#Here_is_how_you_file_a_bug

tags: added: need-info
Changed in fuel:
assignee: Fuel Python Team (fuel-python) → Mike Scherbakov (mihgen)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to fuel-ui (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/295881

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to fuel-ui (master)

Reviewed: https://review.openstack.org/295881
Committed: https://git.openstack.org/cgit/openstack/fuel-ui/commit/?id=d81041ca9125a2797bd5b436b2d8950dfeeed47c
Submitter: Jenkins
Branch: master

commit d81041ca9125a2797bd5b436b2d8950dfeeed47c
Author: Kate Pimenova <email address hidden>
Date: Tue Mar 22 17:57:22 2016 +0300

    Fix for random ui test fail

    Change-Id: I22e1cf620c946829a118cb15a0972b5c6c6d7c66
    Related-Bug: #1549750

Revision history for this message
Mike Scherbakov (mihgen) wrote :

Per Vitaly's comment in https://review.openstack.org/#/c/294976/, patchset doesn't deal with this bug. Removing myself as assignee.

Changed in fuel:
assignee: Mike Scherbakov (mihgen) → Fuel UI Team (fuel-ui)
Changed in fuel:
assignee: Fuel UI Team (fuel-ui) → Fuel Python Team (fuel-python)
Dmitry Pyzhov (dpyzhov)
Changed in fuel:
status: In Progress → Confirmed
tags: removed: need-info
Changed in fuel:
milestone: 9.0 → 10.0
Revision history for this message
Dmitry Pyzhov (dpyzhov) wrote :

Technical debt, doesn't affect real users. Removing from Mitaka release.

Revision history for this message
Dmitry Pyzhov (dpyzhov) wrote :

This bug doesn't block development

Changed in fuel:
importance: Critical → High
Dmitry Pyzhov (dpyzhov)
Changed in fuel:
assignee: Fuel Python (Deprecated) (fuel-python) → Fuel Sustaining (fuel-sustaining-team)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.