Bug 676756

Summary: Quickly hitting "enable" followed by "disable" for a schedule item results in stack
Product: [Other] RHQ Project Reporter: Corey Welton <cwelton>
Component: Core UIAssignee: Charles Crouch <ccrouch>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0.0CC: ccrouch, hbrock, mazz
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-03 16:58:48 UTC Type: ---
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:    
Bug Blocks: 731034, 676752, 678340, 729848, 730796    
Attachments:
Description Flags
a patch that fixes this issue none

Description Corey Welton 2011-02-11 03:15:25 UTC
Description of problem:

Probably a minor nit, but a stacktrace is thrown when user hits the 'enable' button and quickly hits the 'disable' button before the page reloads.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.  $resource > Monitoring > Schedules
2.  Highlight/select a resource
3.  Hit the "Enable" button, and quickly -- before the page refreshes -- hit the "Disable" button
  
Actual results:

Message Center :	
Failed to disable the collection of [0] metrics for resource with ID [10001]. The metrics were: [[]]
Severity :	
Error
	
Time :	
Thu 10 Feb 2011 10:10:03 PM EST
Detail :
java.lang.RuntimeException:javax.ejb.EJBException:java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: unexpected end of subtree [UPDATE org.rhq.core.domain.measurement.MeasurementSchedule SET enabled = false WHERE id IN ( SELECT measurementschedule.id FROM org.rhq.core.domain.measurement.MeasurementSchedule measurementschedule WHERE ( measurementschedule.resource.id IN ( 10001 ) AND measurementschedule.definition.id IN ( ) ) ) ] -> java.lang.IllegalArgumentException:org.hibernate.hql.ast.QuerySyntaxException: unexpected end of subtree [UPDATE org.rhq.core.domain.measurement.MeasurementSchedule SET enabled = false WHERE id IN ( SELECT measurementschedule.id FROM org.rhq.core.domain.measurement.MeasurementSchedule measurementschedule WHERE ( measurementschedule.resource.id IN ( 10001 ) AND measurementschedule.definition.id IN ( ) ) ) ] -> org.hibernate.hql.ast.QuerySyntaxException:unexpected end of subtree [UPDATE org.rhq.core.domain.measurement.MeasurementSchedule SET enabled = false WHERE id IN ( SELECT measurementschedule.id FROM org.rhq.core.domain.measurement.MeasurementSchedule measurementschedule WHERE ( measurementschedule.resource.id IN ( 10001 ) AND measurementschedule.definition.id IN ( ) ) ) ]


Expected results:
Perhaps one/both button(s) should be disabled once either of them is hit?

Additional info:

Similar thing occurs when the reverse behaviour is taken (disable, enable)

Comment 1 Corey Welton 2011-02-11 03:16:16 UTC
Actually, it happens when you hit the same button twice -- accidentally double-clicking, etc.

Comment 2 Ian Springer 2011-08-22 17:43:06 UTC
Created attachment 519323 [details]
a patch that fixes this issue

Comment 3 Ian Springer 2011-08-22 19:23:03 UTC
Commits 1f2e89b and 4c29315 to master should fix this issue as well as prevent similar issues on all list views in the app that extend the Table class (which is 95% of the list views in the app).

The new behavior is as follows:

When the user clicks any of the action buttons in a table's footer, including the Refresh button, that button and all other buttons in the footer will be disabled until either the user cancels the action or the action completes, at which point buttons will be re-enabled as appropriate.

To QA this fix, try quick clicking on action buttons on the schedules list view, as well as a bunch of other list views in the app. Verify that the buttons are disabled when you click on one of them but also that they get re-enabled when you either cancel the action or the action completes.

Comment 4 Mike Foley 2011-08-22 19:30:48 UTC
verified quick-clicking on rows in  table, and more specifically on the repro steps.

Comment 6 Heiko W. Rupp 2013-09-03 16:58:48 UTC
Bulk closing of old issues that are in VERIFIED state.