Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add failure event for queries that were posted but not submitted #24205

Conversation

mduggan-starburst
Copy link
Contributor

Description

Additional context and related issues

Release notes

( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:

## Section
* Fix some things. ({issue}`issuenumber`)

Comment on lines +461 to +463
queryMonitor.queryImmediateFailureEvent(
getBasicQueryInfoForFailure(USER_CANCELED.toErrorCode()),
toFailure(new TrinoException(USER_CANCELED, "Query was canceled")));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not get the flow for cancelation.
Why do we need event code both here and in cancelInternal?

@@ -177,6 +177,55 @@ public void queryCreatedEvent(BasicQueryInfo queryInfo)
Optional::empty)));
}

private static QueryStatistics createEmptyStatistics(Duration queuedTime)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated change. Fine on its own but move to separate commit


private void cancelInternal()
{
if (!dispatchManager.cancelQuery(queryId)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why can't we have event logic in dispatchManager.cancelQuery?
Is that lack of session or the fact that is used from QueryResource too? Or ... ?

@losipiuk
Copy link
Member

Looks generally good. @wendigo PTAL too.
Sorry for late review. I did not notice. Please ping me if I am not responsive.

@hashhar hashhar requested a review from electrum November 27, 2024 13:21
@hashhar
Copy link
Member

hashhar commented Nov 27, 2024

IMO @electrum should also take a look because from my discussion with him in the past this was intentional part of protocol.

trinodb/trino-python-client#394 (comment)

Copy link
Member

@electrum electrum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a bad change, as it will cause bogus events for query resubmission. The query doesn't exist until the client fetches the first next URI.

What problem are you trying to solve? If this is for administrators to debug broken clients, you could add a debug log line for abandoned queries.

@mduggan-starburst
Copy link
Contributor Author

Closed due to conflicts with the Trino protocol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants