From user:
In Visual Analytics, could a “cancel” feature be added when a query is executed after changing a parameter value in the parameter control (or when editing a query/opening a worksheet). In particular this is important now that parameterized queries are supported. We’ve had a handful of cases in which a user selects a wide date range by mistake causing a very long running query to execute. And since there is no cancel feature, they are forced to either wait it out or to close out of ADS completely. A “cancel” button does appear when using the “refresh all data and extracts” but not for any “auto” executed queries.
|
164 KB
![]() |
360 KB
|
364 KB
![]() |
360 KB
All of BI progress dialogs are derived from the same base dialog class which offers a Cancel button. Changing a parameter value eventually triggers a data source refresh action, and data source refresh progress dialog hides the Cancel button provided by the base class. Editing a query implements its own progress dialog which hides the Cancel button provided by the base class, too. We can modify these dialogs (or, implement a new progress dialog for changing parameter value) to show Cancel button if needed, with additional code to handle 'cancel' action if applicable.
Reviewed VA code, enabling Cancel button is one line change but adding code to handle 'cancel' action is not that straightforward. In the current Refresh/EditQuery implementation, 'cancel' means something has gone wrong (e.g. cannot locate connection) and user canceled the request from VA's diagnosis dialog(s); this 'cancel' eventually will turn data source displayed in data pane in red. This 'cancel-on-error' is different than the 'cancel' requested by this issue which is to cancel the query without error encountered. In the scenario described in this issue, after cancel button is clicked, I guess we simply want to cancel the request but not turning data source in red. VA currently cannot tell 'cancel-on-error' from 'cancel-without-error', we need to add code so that 'cancel-on-error'/'cancel-without-error' related information can be passed all the way back to the place where request is originally triggered and handled properly along the entire request chain.
In addition, 'Refresh All Data and Extracts...' does not seem to implement 'cancel' correctly. After 'Refresh All Data and Extracts...' is activated, if you clicked 'Cancel' button before query engine gets involved, VA still replaces the in-memory data with the one newly retrieved; I will look into it along with this issue.
Reviewed VA code, enabling Cancel button is one line change but adding code to handle 'cancel' action is not that straightforward. In the current Refresh/EditQuery implementation, 'cancel' means something has gone wrong (e.g. cannot locate connection) and user canceled the request from VA's diagnosis dialog(s); this 'cancel' eventually will turn data source displayed in data pane in red. This 'cancel-on-error' is different than the 'cancel' requested by this issue which is to cancel the query without error encountered. In the scenario described in this issue, after cancel button is clicked, I guess we simply want to cancel the request but not turning data source in red. VA currently cannot tell 'cancel-on-error' from 'cancel-without-error', we need to add code so that 'cancel-on-error'/'cancel-without-error' related information can be passed all the way back to the place where request is originally triggered and handled properly along the entire request chain.
In addition, 'Refresh All Data and Extracts...' does not seem to implement 'cancel' correctly. After 'Refresh All Data and Extracts...' is activated, if you clicked 'Cancel' button before query engine gets involved, VA still replaces the in-memory data with the one newly retrieved; I will look into it along with this issue.
SVN r45281/17.0.0-alpha-19
Initial implementation to support cancel on Refresh and Edit Query.
There are a couple of problems yet to be resolved, I will look into them:
(1) The "'Refresh All Data and Extracts...' does not seem to implement 'cancel' correctly" problem mentioned here should work for query now, extracts related code yet to be reviewed.
(2) In the current implementation, once query is submitted to query engine, pressing cancel button in UI will dismiss the progress dialog and allow user to interact with VA again but it did not stop query engine; i.e. background thread will continue to run, its outcome is ignored, though.
SVN r45281/17.0.0-alpha-19
Initial implementation to support cancel on Refresh and Edit Query.
There are a couple of problems yet to be resolved, I will look into them:
(1) The "'Refresh All Data and Extracts...' does not seem to implement 'cancel' correctly" problem mentioned here should work for query now, extracts related code yet to be reviewed.
(2) In the current implementation, once query is submitted to query engine, pressing cancel button in UI will dismiss the progress dialog and allow user to interact with VA again but it did not stop query engine; i.e. background thread will continue to run, its outcome is ignored, though.
(1) The "'Refresh All Data and Extracts...' does not seem to implement 'cancel' correctly" problem mentioned here should work for query now, extracts related code yet to be reviewed.Reviewed extract specific code related to 'Refresh All Extracts...' and 'Refresh All Data and Extracts...' and tested cancel button, both work fine.
(1) The "'Refresh All Data and Extracts...' does not seem to implement 'cancel' correctly" problem mentioned here should work for query now, extracts related code yet to be reviewed.Reviewed extract specific code related to 'Refresh All Extracts...' and 'Refresh All Data and Extracts...' and tested cancel button, both work fine.
SVN r45288/17.0.0-alpha-21
Notify query engine to stop execution after VA Cancel button is clicked.
SVN r45288 should address the following problem:
(2) In the current implementation, once query is submitted to query engine, pressing cancel button in UI will dismiss the progress dialog and allow user to interact with VA again but it did not stop query engine; i.e. background thread will continue to run, its outcome is ignored, though.
VA and query engine each maintains its own 'cancel object' to determine whether operation should be continued or canceled at a particular time. When the Cancel button displayed in VA dialog is clicked, the followings will happen:
(a) The state of VA's cancel object is changed to true.
(b) The background thread in which query engine is executed is interrupted.
Although query-engine-thread is interrupted, it continues to run because it uses the state of its 'cancel object' to determine whether to stop execution or not. SVN r45288 provided a hook so that after VA's cancel button is clicked, VA not only interrupts query-engine-thread but also changes the state of query-engine's cancel object to true.
Notes: An easier way to address the problem described above is to just modify query-engine (AFScriptContext.java) but not VA codes so that query-engine uses both the state of its cancel object (true or false) and the state of its owning thread (interrupted or not) to determine whether to stop execution; if either cancel is set to true or thread is interrupted, the execution is terminated. However, I did not modify AFScriptContext.java because it is shared by all of ADS objects; I assumed it has its own concerns to not check thread's state.
SVN r45288/17.0.0-alpha-21
Notify query engine to stop execution after VA Cancel button is clicked.
SVN r45288 should address the following problem:
(2) In the current implementation, once query is submitted to query engine, pressing cancel button in UI will dismiss the progress dialog and allow user to interact with VA again but it did not stop query engine; i.e. background thread will continue to run, its outcome is ignored, though.
VA and query engine each maintains its own 'cancel object' to determine whether operation should be continued or canceled at a particular time. When the Cancel button displayed in VA dialog is clicked, the followings will happen:
(a) The state of VA's cancel object is changed to true.
(b) The background thread in which query engine is executed is interrupted.
Although query-engine-thread is interrupted, it continues to run because it uses the state of its 'cancel object' to determine whether to stop execution or not. SVN r45288 provided a hook so that after VA's cancel button is clicked, VA not only interrupts query-engine-thread but also changes the state of query-engine's cancel object to true.
Notes: An easier way to address the problem described above is to just modify query-engine (AFScriptContext.java) but not VA codes so that query-engine uses both the state of its cancel object (true or false) and the state of its owning thread (interrupted or not) to determine whether to stop execution; if either cancel is set to true or thread is interrupted, the execution is terminated. However, I did not modify AFScriptContext.java because it is shared by all of ADS objects; I assumed it has its own concerns to not check thread's state.
The Scenario 2 described here is irrelevant to this issue.
The Cancel button described in Scenario 2 is the Cancel button presented in the 'Calculating Visualization' dialog but not the Cancel button presented in 'Refresh Data Source' dialog; these 2 Cancel buttons are two different implementations for handling different things. The goal of this issue is to provide a Cancel button in 'Refresh Data Source' dialog which has nothing to do with 'Calculating Visualization' dialog.
Please log Scenario 2 as a separate issue and assign to people who are working on model calculation or people working on worksheet chart to take a look first.
The Scenario 2 described here is irrelevant to this issue.
The Cancel button described in Scenario 2 is the Cancel button presented in the 'Calculating Visualization' dialog but not the Cancel button presented in 'Refresh Data Source' dialog; these 2 Cancel buttons are two different implementations for handling different things. The goal of this issue is to provide a Cancel button in 'Refresh Data Source' dialog which has nothing to do with 'Calculating Visualization' dialog.
Please log Scenario 2 as a separate issue and assign to people who are working on model calculation or people working on worksheet chart to take a look first.
@ashwini.chavan: I think the case you described here is a different scenario and hence logged it as VA #3741. [SP] Agreed
@ashwini.chavan: I think the case you described here is a different scenario and hence logged it as VA #3741. [SP] Agreed
Verified in ADS v17.0.0-rc-49, Cancel is now added
Verified in ADS v17.0.0-rc-49, Cancel is now added
Issue #13170 |
Closed |
Fixed |
Resolved |
Completion |
No due date |
Fixed Build ADS 17.0.0-alpha-21 |
No time estimate |
2 issue links |
relates to #13172
Issue #13172Auto Refresh - no modal dialog during refresh operation |
relates to #14830
Issue #14830Edit Query dialog gets disabled when attempting to cancel query |
All of BI progress dialogs are derived from the same base dialog class which offers a Cancel button. Changing a parameter value eventually triggers a data source refresh action, and data source refresh progress dialog hides the Cancel button provided by the base class. Editing a query implements its own progress dialog which hides the Cancel button provided by the base class, too. We can modify these dialogs (or, implement a new progress dialog for changing parameter value) to show Cancel button if needed, with additional code to handle 'cancel' action if applicable.