Bug 1500142

Summary: recipe page system dropdown collapses immediately after clicking
Product: [Retired] Beaker Reporter: Anwesha Chatterjee <achatter>
Component: web UIAssignee: Anwesha Chatterjee <achatter>
Status: CLOSED CURRENTRELEASE QA Contact: Anwesha Chatterjee <achatter>
Severity: low Docs Contact:
Priority: unspecified    
Version: 24CC: achatter, anderson, dcallagh, jorris, lzap, mjia, mpetlan, pgeorgie, rjoost, zsun
Target Milestone: 24.5Keywords: Patch, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1358619 Environment:
Last Closed: 2017-10-27 06:47:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1358619    
Bug Blocks:    

Description Anwesha Chatterjee 2017-10-10 03:44:09 UTC
Description of problem:
The system dropdown link does not stay open for more than a second upon clicking

How reproducible:
always

Steps to Reproduce:
1. Go to the recipe page, for a recipe which is currently reserved
2. Click the arrow next to the system name in the recipe summary section


Actual results:
the dropdown closes immediately after clicking

Expected results:
the dropdown stays open 

Additional info:
This is probably due to the re-rendering of recipe summary per second of watchdog countdown introduced in https://bugzilla.redhat.com/show_bug.cgi?id=1358619

Comment 1 Anwesha Chatterjee 2017-10-10 04:32:08 UTC
Update: There is a listenTo() for *all* changes in the model in the initialisation RecipeSummaryView. This will need to be narrowed down to only listenTo() changes of interest in the model in order to stop the constant re-rendering.

Comment 2 Anwesha Chatterjee 2017-10-11 23:11:30 UTC
https://gerrit.beaker-project.org/#/c/5871/

Comment 3 Anwesha Chatterjee 2017-10-11 23:58:35 UTC
*** Bug 1500777 has been marked as a duplicate of this bug. ***

Comment 4 Dan Callaghan 2017-10-16 06:34:24 UTC
*** Bug 1501777 has been marked as a duplicate of this bug. ***

Comment 7 Dan Callaghan 2017-10-20 07:16:40 UTC
However, it looks like we have a very similar problem on the job page. While a recipe is running, it's impossible to select the hostname from the recipe row (in order to copy it to the clipboard).

I am guessing that it's the same underlying problem (the row is being re-rendered once per second due to the change event on the watchdog timer).

Comment 8 Dan Callaghan 2017-10-20 07:25:02 UTC
Another place that is affected: the recipe page header. Can't copy-paste the recipe id easily.

I am wondering if we need to just revert bug 1358619 entirely and find a different solution. It has caused problems in a lot of places.

Comment 9 Anwesha Chatterjee 2017-10-23 00:22:47 UTC
*** Bug 1504785 has been marked as a duplicate of this bug. ***

Comment 10 Dan Callaghan 2017-10-23 03:20:21 UTC
I suspect this has also caused bug 1500974 -- if we have a lot of templates being re-rendered once per second it could contribute to high CPU usage.

Comment 11 Dan Callaghan 2017-10-23 03:31:18 UTC
I tried to find all the other problem areas by grepping for:

    listenTo.*change[ ']

and then inspecting each location to see if it was using a Recipe model. That led me to these:

https://gerrit.beaker-project.org/5881 more targetted re-rendering for the recipe page header
https://gerrit.beaker-project.org/5882 more targetted re-rendering for the job page recipe rows
https://gerrit.beaker-project.org/5883 more targetted re-rendering for the recipe progress bar

Comment 12 Dan Callaghan 2017-10-23 04:07:44 UTC
I used the Performance tab in Firefox dev tools to compare Beaker 24.4 vs. the above patches, on the job page and the recipe page. For both pages, it shows that the JS is now basically idle the whole time (except for the auto-fetch which happens every 30 seconds) with the patches in place. Whereas on Beaker 24.4 there is a substantial amount of CPU time (several seconds over a 1 minute profile) spent on template rendering and parsing HTML and DOM manipulation.

So I think we the above three, we have got them all -- and hopefully fixes bug 1500974 as well.

Comment 14 Anwesha Chatterjee 2017-10-26 09:25:20 UTC
*** Bug 1506462 has been marked as a duplicate of this bug. ***

Comment 15 Anwesha Chatterjee 2017-10-26 09:35:36 UTC
Verified. For a running recipe:

* I am able to select the hostname in the jobs page. 
* I am able to select parts of the recipe header.

Comment 16 Dan Callaghan 2017-10-27 06:47:33 UTC
Beaker 24.5 has been released.

Comment 17 Dan Callaghan 2017-12-06 02:45:28 UTC
*** Bug 1500974 has been marked as a duplicate of this bug. ***