Description of problem: Issues with any dialog that has auto-refreshing set up on any of the fields. Now that we are using a concurrent web server, when fields change it was immediately kicking off a trigger to auto-refresh, and that transaction was completing before the field change transaction would be completed. Ideally, the field change wouldn't need a transaction and the state of the form would be handled in the javascript, but right now it's all handled server side so the order things were being done was causing problems. Version-Release number of selected component (if applicable): 5.5
Changing this bug over to 5.5.z. The basic symptoms were originally reported on upstream and fixed in https://github.com/ManageIQ/manageiq/pull/7661 before 5.6 was branched. Git Issue: https://github.com/ManageIQ/manageiq/issues/7272 Talk Topics: http://talk.manageiq.org/t/reading-dialog-form-values-from-a-refresh-event/1322 http://talk.manageiq.org/t/azure-windows-service-provisioning-failure-basic-information-parameters-virtual-machine-size-is-required/1320 My concern is that 5.5 used the Thin web-server which did not support concurrency. The 5.6 build changed to use the Puma web-server which does support concurrency. It is unclear at the moment how the customer could be running into this issue on 5.5. MR https://gitlab.cloudforms.lab.eng.rdu2.redhat.com/cloudforms/cfme/merge_requests/952 was created for testing in their environment.
New commit detected on cfme/5.5.z: https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=db188f27d79012338a9c108e54fbcbc31ec08777 commit db188f27d79012338a9c108e54fbcbc31ec08777 Author: Erik Clarizio <eclarizi> AuthorDate: Fri Apr 1 09:10:01 2016 -0700 Commit: Erik Clarizio <eclarizi> CommitDate: Wed May 25 13:24:42 2016 -0700 Implement $.when for triggering auto-refresh callbacks https://bugzilla.redhat.com/show_bug.cgi?id=1339751 app/assets/javascripts/dialog_field_refresh.js | 9 +++--- app/assets/javascripts/miq_application.js | 20 +++++++----- app/assets/javascripts/miq_ujs_bindings.js | 36 ++++++++++++---------- .../application_controller/dialog_runner.rb | 11 ------- 4 files changed, 36 insertions(+), 40 deletions(-)
New commit detected on cfme/5.5.z: https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=31a105b4815a6388bf2ef5bcc434668c8b8b1961 commit 31a105b4815a6388bf2ef5bcc434668c8b8b1961 Author: Erik Clarizio <eclarizi> AuthorDate: Fri Apr 1 13:05:25 2016 -0700 Commit: Erik Clarizio <eclarizi> CommitDate: Wed May 25 13:24:45 2016 -0700 Fix specs to account for new way of executing trigger callback https://bugzilla.redhat.com/show_bug.cgi?id=1339751 spec/javascripts/dialog_field_refresh_spec.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
New commit detected on cfme/5.5.z: https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=ac35f152bc0d946f29d1515bdadbc76d16e72b39 commit ac35f152bc0d946f29d1515bdadbc76d16e72b39 Author: Erik Clarizio <eclarizi> AuthorDate: Tue Apr 5 10:52:10 2016 -0700 Commit: Erik Clarizio <eclarizi> CommitDate: Wed May 25 13:24:49 2016 -0700 Ensure miqJqueryRequest returns a deferred promise so that $.when works https://bugzilla.redhat.com/show_bug.cgi?id=1339751 app/assets/javascripts/miq_application.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
New commit detected on cfme/5.5.z: https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=377b62a07935deeaaab6ddafbbc964884242d865 commit 377b62a07935deeaaab6ddafbbc964884242d865 Merge: 171e8d4 6e0ec16 Author: Greg McCullough <gmccullo> AuthorDate: Wed Jun 1 17:03:53 2016 -0400 Commit: Greg McCullough <gmccullo> CommitDate: Wed Jun 1 17:03:53 2016 -0400 Merge branch 'MR-for-PR7661' into '5.5.z' Issue with auto-refresh transactions not firing after they should Was sent this issue by Jared Deubel, it appears as though a customer is having issues with concurrent transactions. We didn't have a BZ for this before, the cherry-picks were from this PR: https://github.com/ManageIQ/manageiq/pull/7661, which only has ties to a git issue and a manageiq talk topic. The cherry-picks had a few very minor conflicts that didn't even really seem like conflicts, I'm not sure why git couldn't figure it out. https://bugzilla.redhat.com/show_bug.cgi?id=1339751 See merge request !952 app/assets/javascripts/dialog_field_refresh.js | 9 +++--- app/assets/javascripts/miq_application.js | 25 +++++++++------ app/assets/javascripts/miq_ujs_bindings.js | 36 ++++++++++++---------- .../application_controller/dialog_runner.rb | 11 ------- spec/javascripts/dialog_field_refresh_spec.js | 10 +++--- 5 files changed, 45 insertions(+), 46 deletions(-)
New commit detected on cfme/5.5.z: https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=6e0ec169d19f96c37dfbbcf9f7a8d2d94b0a2a6d commit 6e0ec169d19f96c37dfbbcf9f7a8d2d94b0a2a6d Author: Erik Clarizio <eclarizi> AuthorDate: Thu May 26 11:36:20 2016 -0700 Commit: Erik Clarizio <eclarizi> CommitDate: Thu May 26 11:36:20 2016 -0700 Do not attempt to use callback if it does not exist https://bugzilla.redhat.com/show_bug.cgi?id=1339751 app/assets/javascripts/miq_application.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
AFAIU - if I create a dynamic dialog with auto refresh and I change things, the requests in the automate must not overlap, is that right?
It's ok if the refreshes overlap, but what was happening before was that as soon as something was changed, the refresh was being triggered, and sometimes the refresh would finish before the request for the actual thing being changed finished, causing a data sync issue. If you have something like a drop down that triggers auto-refresh and 3 other fields that respond to auto-refreshes, and you choose something from said drop down, it is expected that all 3 of the other requests execute simultaneously. However, they should all not even start to execute until after the "dialog_field_changed" request from selecting something in that drop down finishes. Does that help?
So it should look something like this?: [----] I, [2016-07-15T09:14:43.767502 #2196:b7b998] INFO -- : Started POST "/catalog/dialog_field_changed/24?test1=dsfgsdgfewrg" for 127.0.0.1 at 2016-07-15 09:14:43 -0400 [----] I, [2016-07-15T09:14:43.770174 #2196:b7b998] INFO -- : Processing by CatalogController#dialog_field_changed as JS [----] I, [2016-07-15T09:14:43.770324 #2196:b7b998] INFO -- : Parameters: {"test1"=>"dsfgsdgfewrg", "id"=>"24"} [----] I, [2016-07-15T09:14:43.881962 #2196:b7b998] INFO -- : Completed 200 OK in 111ms (Views: 0.9ms | ActiveRecord: 5.8ms) [----] I, [2016-07-15T09:14:44.056235 #2196:b7b998] INFO -- : Started POST "/catalog/dynamic_radio_button_refresh" for 127.0.0.1 at 2016-07-15 09:14:44 -0400 [----] I, [2016-07-15T09:14:44.058644 #2196:b7b998] INFO -- : Processing by CatalogController#dynamic_radio_button_refresh as */* [----] I, [2016-07-15T09:14:44.058820 #2196:b7b998] INFO -- : Parameters: {"name"=>"test2", "checked_value"=>""} [----] I, [2016-07-15T09:14:46.753582 #2196:b7b998] INFO -- : Completed 200 OK in 2694ms (Views: 0.8ms | ActiveRecord: 23.6ms) [----] I, [2016-07-15T09:14:46.780471 #2196:b7b998] INFO -- : Started POST "/catalog/dynamic_radio_button_refresh" for 127.0.0.1 at 2016-07-15 09:14:46 -0400 [----] I, [2016-07-15T09:14:46.782936 #2196:b7b998] INFO -- : Processing by CatalogController#dynamic_radio_button_refresh as */* [----] I, [2016-07-15T09:14:46.783131 #2196:b7b998] INFO -- : Parameters: {"name"=>"test3", "checked_value"=>""} [----] I, [2016-07-15T09:14:49.499150 #2196:b7b998] INFO -- : Completed 200 OK in 2716ms (Views: 1.3ms | ActiveRecord: 27.0ms) [----] I, [2016-07-15T09:14:49.524851 #2196:b7b998] INFO -- : Started POST "/catalog/dynamic_radio_button_refresh" for 127.0.0.1 at 2016-07-15 09:14:49 -0400 [----] I, [2016-07-15T09:14:49.527032 #2196:b7b998] INFO -- : Processing by CatalogController#dynamic_radio_button_refresh as */* [----] I, [2016-07-15T09:14:49.527177 #2196:b7b998] INFO -- : Parameters: {"name"=>"test4", "checked_value"=>""} [----] I, [2016-07-15T09:14:52.325483 #2196:b7b998] INFO -- : Completed 200 OK in 2798ms (Views: 1.2ms | ActiveRecord: 27.0ms) The first one (test1) is set to trigger refresh on other fields, the other three are set to auto refresh. What worries me is taht all the 4 elements are dropdowns but the methods called are the dynamic_radio:button_refresh ... :)
Yeah, that looks fine. I agree it's a little confusing, we should probably change the name of the action to fit better. I believe when I first started implementing dynamic dialog fields, radio buttons were one of the first ones I did, and the exact same data format gets sent for drop downs, so it was just overlooked that I forgot to change the method name.
So after discussion with Eric moving to VERIFIED state.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2016-1488.html