Number of GET requests grows exponentially when multiple rows are being updated in the table

Bug #1263665 reported by Anastasia Karpinska on 2013-12-23
38
This bug affects 6 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
High
Timur Sufiev
Icehouse
High
Doug Fish
Juno
High
Doug Fish
Kilo
High
Doug Fish

Bug Description

1. In Launch instance dialog select number of instances 10.
2. Create 10 instances.
2. While instances are being created and table rows are being updated the number of row update requests grows exponentially and a queue of pending requests still exists after all rows had beed updated.

There is a request type:
Request URL:http://donkey017/project/instances/?action=row_update&table=instances&obj_id=7c4eaf35-ebc0-4ea3-a702-7554c8c36cf2
Request Method:GET

Changed in horizon:
assignee: nobody → Anastasia Karpinska (anastasia-karpinska)
status: New → In Progress
Kieran Spear (kspear) wrote :

horizon/static/horizon/js/horizon.tables.js

      complete: function (jqXHR, textStatus) {
...
            next_poll = interval * decay_constant;
            // Limit the interval to 30 secs
            if(next_poll > 30 * 1000) { next_poll = 30 * 1000; }
            setTimeout(horizon.datatables.update, next_poll);
      }

This code gets run every time *each* request completes, so if two requests complete, we call horizon.datatables.update twice and each of those calls starts two new requests.

Kieran Spear (kspear) wrote :

Unassigning due to inactivity. Feel free to reassign if you'd like to continue working on it.

Changed in horizon:
assignee: Anastasia Karpinska (anastasia-karpinska) → nobody
importance: Undecided → Medium
status: In Progress → Confirmed
Changed in horizon:
assignee: nobody → Dave Fogelson (78luphr0rnk2nuqimstywepozxn9kl19tqh0tx66b5dki1xxsh5mkz9gl21a5rlwfnr8jn6ln0m3jxne2k9x1ohg85w3jabxlrqbgszpjpwcmvkbc-7ul3h2nks-a811i2i3ytqlsztthjth0svbccw8inm65tmkqp9sarr553jq53in4xm1m8wn3o4rlwaer06ogwvqwv9mrqoku2x334n7di44o65qze67n1wneepmi)
Dave Fogelson (lurkingfrog) wrote :

I'm going to add a test to prove it is fixed. Since there is nothing in place to test this particular javascript function, I've created bug https://bugs.launchpad.net/horizon/+bug/1318407 to make a home for it. Once that is in place, I can come back and add the specific test for this bug.

Timur Sufiev (tsufiev-x) wrote :

Dave, is that bug already fixed? I've just fixed it myself (didn't check horizon's LP before fixing it, unfortunately) - but the words 'to prove it is fixed' imply that it was already done. Having looked at horizon's master at github, I didn't found a fix (https://github.com/openstack/horizon/blob/master/horizon/static/horizon/js/horizon.tables.js#L105) - so I'm a bit confused now.

Dave Fogelson (lurkingfrog) wrote :

Timur,

Long story short, I think I solved the problem with about 4 lines of code I didn't push the code to gerrit since I don't consider a bug fixed until I can make an automated test for it. I wouldn't submit one without the other. Since then, I've been a bit buried at work and haven't had the time to figure out Jasmine and how to write the tests it needs.

If you have a solution ready to go that you are confident in, feel free to push it. Otherwise I'm hoping to get to the testing tomorrow (at least for https://bugs.launchpad.net/horizon/+bug/1318407)

Dave

Timur Sufiev (tsufiev-x) wrote :

Dave,

No problem, I can wait a couple of days for the proper fix to come. It would be interesting to see a test for that kind of bug.

kennychu (kenny-chu123) wrote :

Does anyone fix it and push the code to gerrit?

Timur Sufiev (tsufiev-x) wrote :

Dave, I'm going to push my fix for this bug in a day.

Fix proposed to branch: master
Review: https://review.openstack.org/113855

Changed in horizon:
assignee: Dave Fogelson (lurkingfrog) → Timur Sufiev (tsufiev-x)
status: Confirmed → In Progress
Timur Sufiev (tsufiev-x) wrote :

I've managed to provide a crude hand-written AJAX-stub for the unit test for this regression. Ugly, but works. Any ideas on how to improve it are welcomed.

Fix proposed to branch: master
Review: https://review.openstack.org/126342

Change abandoned by Timur Sufiev (<email address hidden>) on branch: master
Review: https://review.openstack.org/126342
Reason: Created new change-id by mistake

Changed in horizon:
milestone: none → liberty-1

Reviewed: https://review.openstack.org/113855
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=ca090378b4875afebdebd67bdb457eebad6b2b7d
Submitter: Jenkins
Branch: master

commit ca090378b4875afebdebd67bdb457eebad6b2b7d
Author: Timur Sufiev <email address hidden>
Date: Thu Apr 30 12:54:29 2015 +0300

    Fix exponentially growing AJAX updates for table rows

    Schedule next table rows update only when the last row was
    updated. Since unit-test for this fix relies on a blueprint
    replace-qunit-tests-with-jasmine it is moved to a separate commit to
    speed up this fix merge, see https://review.openstack.org/#/c/179013/

    Change-Id: Id603a4fde5713d8f2b85b1dcf72c82c93a87c755
    Closes-Bug: #1263665

Changed in horizon:
status: In Progress → Fix Committed

Reviewed: https://review.openstack.org/179266
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=db641dccb68ae3ff0bdd70dc7d60dc9605fe31c0
Submitter: Jenkins
Branch: stable/juno

commit db641dccb68ae3ff0bdd70dc7d60dc9605fe31c0
Author: Timur Sufiev <email address hidden>
Date: Thu Apr 30 12:54:29 2015 +0300

    Fix exponentially growing AJAX updates for table rows

    Schedule next table rows update only when the last row was
    updated. Since unit-test for this fix relies on a blueprint
    replace-qunit-tests-with-jasmine it is moved to a separate commit to
    speed up this fix merge, see https://review.openstack.org/#/c/179013/

    Closes-Bug: #1263665
    (cherry picked from commit ca090378b4875afebdebd67bdb457eebad6b2b7d)

    Conflict Resolution Notes:
    cherry-pick needed to have the old body of the complete: function
    manually removed - it wasn't sure if it still belonged (resulting in
    nearly duplicate code) or should be removed. I'm a bit surprised the
    cherry-pick didn't auto-resolve.

    Conflicts:
     horizon/static/horizon/js/horizon.tables.js

    Change-Id: Id603a4fde5713d8f2b85b1dcf72c82c93a87c755

tags: added: in-stable-juno
Doug Fish (drfish) on 2015-05-06
Changed in horizon:
importance: Medium → High

Reviewed: https://review.openstack.org/179265
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=bb0523722fea08146404587831a26c8692a3bb5a
Submitter: Jenkins
Branch: stable/kilo

commit bb0523722fea08146404587831a26c8692a3bb5a
Author: Timur Sufiev <email address hidden>
Date: Thu Apr 30 12:54:29 2015 +0300

    Fix exponentially growing AJAX updates for table rows

    Schedule next table rows update only when the last row was
    updated. Since unit-test for this fix relies on a blueprint
    replace-qunit-tests-with-jasmine it is moved to a separate commit to
    speed up this fix merge, see https://review.openstack.org/#/c/179013/

    Closes-Bug: #1263665
    (cherry picked from commit ca090378b4875afebdebd67bdb457eebad6b2b7d)

    Conflict Resolution Notes:
    cherry-pick needed to have the old body of the complete: function
    manually removed - it wasn't sure if it still belonged (resulting in
    nearly duplicate code) or should be removed. I'm a bit surprised the
    cherry-pick didn't auto-resolve.

    Conflicts:
     horizon/static/horizon/js/horizon.tables.js

    Change-Id: Id603a4fde5713d8f2b85b1dcf72c82c93a87c755

tags: added: in-stable-kilo
tags: added: in-stable-icehouse

Reviewed: https://review.openstack.org/179268
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=78b6f5ed6145dcb2e9ce2caed0c87d159c12697b
Submitter: Jenkins
Branch: stable/icehouse

commit 78b6f5ed6145dcb2e9ce2caed0c87d159c12697b
Author: Timur Sufiev <email address hidden>
Date: Thu Apr 30 12:54:29 2015 +0300

    Fix exponentially growing AJAX updates for table rows

    Schedule next table rows update only when the last row was
    updated. Since unit-test for this fix relies on a blueprint
    replace-qunit-tests-with-jasmine it is moved to a separate commit to
    speed up this fix merge, see https://review.openstack.org/#/c/179013/

    Closes-Bug: #1263665
    (cherry picked from commit ca090378b4875afebdebd67bdb457eebad6b2b7d)

    Conflict Resolution Notes:
    cherry-pick needed to have the old body of the complete: function
    manually removed - it wasn't sure if it still belonged (resulting in
    nearly duplicate code) or should be removed. I'm a bit surprised the
    cherry-pick didn't auto-resolve.

    Conflicts:
     horizon/static/horizon/js/horizon.tables.js

    Change-Id: Id603a4fde5713d8f2b85b1dcf72c82c93a87c755

Changed in horizon:
status: Fix Committed → Fix Released

Change abandoned by David Lyle (<email address hidden>) on branch: master
Review: https://review.openstack.org/179013
Reason: This review is > 4 weeks without comment, and failed Jenkins the last time it was checked. We are abandoning this for now. Feel free to reactivate the review by pressing the restore button and leaving a 'recheck' comment to get fresh test results.

Thierry Carrez (ttx) on 2015-10-15
Changed in horizon:
milestone: liberty-1 → 8.0.0
Alan Pevec (apevec) on 2015-11-17
tags: removed: in-stable-icehouse in-stable-juno in-stable-kilo
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers