This is an automated email from the ASF dual-hosted git repository.
gian pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git
The following commit(s) were added to refs/heads/master by this push:
new 844f4fa04bb Console: Improve cancellation in current-dart-panel.
(#19182)
844f4fa04bb is described below
commit 844f4fa04bbabb80ef29b005f26efde3a2c85317
Author: Gian Merlino <[email protected]>
AuthorDate: Fri Mar 20 08:30:20 2026 -0700
Console: Improve cancellation in current-dart-panel. (#19182)
Two improvements:
1) Only show "Cancel query" if the query is ACCEPTED or RUNNING.
2) Cancellation can sometimes return 404 even when successful if there
are multiple Brokers. It can also return 404 if the query finished
before it could be canceled. Neither of these really deserve a
"danger" toast. Change to a success toast with text "Query canceled
or no longer running".
---
.../current-dart-panel/current-dart-panel.tsx | 51 +++++++++++++++-------
1 file changed, 35 insertions(+), 16 deletions(-)
diff --git
a/web-console/src/views/workbench-view/current-dart-panel/current-dart-panel.tsx
b/web-console/src/views/workbench-view/current-dart-panel/current-dart-panel.tsx
index 7e0deff6e11..b76ed7107bf 100644
---
a/web-console/src/views/workbench-view/current-dart-panel/current-dart-panel.tsx
+++
b/web-console/src/views/workbench-view/current-dart-panel/current-dart-panel.tsx
@@ -118,13 +118,28 @@ export const CurrentDartPanel = React.memo(function
CurrentViberPanel(
});
}}
/>
- <MenuDivider />
<MenuItem
- icon={IconNames.CROSS}
- text="Cancel query"
- intent={Intent.DANGER}
- onClick={() => setConfirmCancelId(w.sqlQueryId)}
+ icon={IconNames.DUPLICATE}
+ text="Copy Identity"
+ onClick={() => {
+ copy(w.identity, { format: 'text/plain' });
+ AppToaster.show({
+ message: `${w.identity} copied to clipboard`,
+ intent: Intent.SUCCESS,
+ });
+ }}
/>
+ {(w.state === 'ACCEPTED' || w.state === 'RUNNING') && (
+ <>
+ <MenuDivider />
+ <MenuItem
+ icon={IconNames.CROSS}
+ text="Cancel query"
+ intent={Intent.DANGER}
+ onClick={() => setConfirmCancelId(w.sqlQueryId)}
+ />
+ </>
+ )}
</Menu>
);
@@ -176,18 +191,22 @@ export const CurrentDartPanel = React.memo(function
CurrentViberPanel(
if (!confirmCancelId) return;
try {
await
Api.instance.delete(`/druid/v2/sql/${Api.encodePath(confirmCancelId)}`);
-
- AppToaster.show({
- message: 'Query canceled',
- intent: Intent.SUCCESS,
- });
- queryManager.rerunLastQuery();
- } catch {
- AppToaster.show({
- message: 'Could not cancel query',
- intent: Intent.DANGER,
- });
+ } catch (e: any) {
+ if (e.response?.status === 404) {
+ // Query may have already completed or been canceled, which is
fine.
+ } else {
+ AppToaster.show({
+ message: 'Could not cancel query',
+ intent: Intent.DANGER,
+ });
+ return;
+ }
}
+ AppToaster.show({
+ message: 'Query canceled or no longer running',
+ intent: Intent.SUCCESS,
+ });
+ queryManager.rerunLastQuery();
}}
onDismiss={() => setConfirmCancelId(undefined)}
/>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]