koszti commented on a change in pull request #15403:
URL: https://github.com/apache/superset/pull/15403#discussion_r667045725



##########
File path: superset-frontend/src/SqlLab/components/SqlEditor.jsx
##########
@@ -242,6 +245,13 @@ class SqlEditor extends React.PureComponent {
     }
   }
 
+  onBeforeUnload(event) {
+    if (this.props.latestQuery?.state === 'running') {
+      event.preventDefault();
+      this.stopQuery();

Review comment:
       Can we make it at least configurable? I’m happy to go for the extra mile 
if needed and add a new extra param to the db config if no objections. We 
really need to cancel all db queries both in sync and async modes.
   
   This is because we’d like to go with async mode to utilise the celery 
workers but we still expect a lot of accidental cross joins, missing WHERE 
clauses and unwanted long running queries. In this case people will just close 
the browser and that’s making other people impossible running new queries. DBs 
like snowflake start queuing queries very quickly and unwanted long running 
queries easily could block using the entire db for long hours. Or DBAs have to 
kill unwanted queries manually.
   
   Furthermore if it works only in sync mode then the stop button is basically 
doing nothing in async mode with non hive/presto databases.
   
   Let me know your thoughts 🙇 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to