Repository navigation
fix: Raise Trino monitoring query errors other than a missing table - #6918
Merged
ntkathole merged 1 commit intoOct 1, 2026
Merged
Conversation
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6918 +/- ##
==========================================
- Coverage 48.50% 48.50% -0.01%
==========================================
Files 427 427
Lines 53755 53758 +3
Branches 7827 7828 +1
==========================================
Hits 26076 26076
- Misses 25813 25816 +3
Partials 1866 1866
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
4 of 7 tasks
ntkathole
approved these changes
Oct 1, 2026
query_monitoring_metrics returned [] for every TrinoQueryError. A missing table or schema still means no metrics yet; any other query error is now logged and re-raised, as ensure_monitoring_tables already does. An empty result made DQMJobManager.get_job report a job as missing, so update_status dropped status changes without an error. Signed-off-by: Eric Del Orefice <114540347+ericdelorefice@users.noreply.github.com>
ntkathole
force-pushed
the
trino-monitoring-errors
branch
from
October 1, 2026 12:33
cd3265e to
cb584b6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
Problem
TrinoOfflineStore.query_monitoring_metricscatches everyTrinoQueryError, logs it at debug level and returns[]. The test for it,test_query_monitoring_metrics_handles_query_error, usesTABLE_NOT_FOUND, and that case is right: no table means no metrics yet. But the handler also returns[]forACCESS_DENIED, a syntax error or an internal error.ensure_monitoring_tablesin the same file already draws this line. It acceptsCOLUMN_ALREADY_EXISTSand raises everything else, andtest_ensure_monitoring_tables_raises_on_permission_errorpins that.An empty list has real consequences in the callers:
MonitoringServicecalls_ensure_monitoring_tables()right before querying, so on that path the table exists and the handler only ever hides real errors behind an empty result.DQMJobManager.get_jobreturnsNonefor[], andupdate_statusreturns early when the job isNone. A failed read while marking a job running, completed or failed drops the status update without an error, and the job stays in its old state.Reproduction
A mocked client raising
TrinoQueryError({"errorName": "ACCESS_DENIED", ...}), onmaster:query_monitoring_metrics(...)returns[]and nothing is raised. The same forSYNTAX_ERRORandGENERIC_INTERNAL_ERROR.Change
TABLE_NOT_FOUNDandSCHEMA_NOT_FOUNDstill return[], since either means the monitoring table has not been created yet. Any otherTrinoQueryErroris logged and re-raised, the same as inensure_monitoring_tables.Verification
Two new tests in
test_trino_monitoring.py. One coversSCHEMA_NOT_FOUNDreturning[]. The other, parametrized overACCESS_DENIED,SYNTAX_ERRORandGENERIC_INTERNAL_ERROR, checks that the error is raised. Onmasterthe 3 parametrized cases fail and the 2 not-found cases pass, including the existingTABLE_NOT_FOUNDtest. With the change, the Trino offline store tests are 28 passed.ruff checkandruff format --checkare clean.Which issue(s) this PR fixes:
None filed. The reproduction is above. This follows the Trino monitoring support added in #6779.
Checks
git commit -s)Testing Strategy