Skip to content

fix: Raise Trino monitoring query errors other than a missing table - #6918

Merged
ntkathole merged 1 commit into
feast-dev:masterfrom
ericdelorefice:trino-monitoring-errors
Oct 1, 2026
Merged

ntkathole merged 1 commit into
feast-dev:masterfrom
ericdelorefice:trino-monitoring-errors

Conversation

@ericdelorefice

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Problem

TrinoOfflineStore.query_monitoring_metrics catches every TrinoQueryError, logs it at debug level and returns []. The test for it, test_query_monitoring_metrics_handles_query_error, uses TABLE_NOT_FOUND, and that case is right: no table means no metrics yet. But the handler also returns [] for ACCESS_DENIED, a syntax error or an internal error.

ensure_monitoring_tables in the same file already draws this line. It accepts COLUMN_ALREADY_EXISTS and raises everything else, and test_ensure_monitoring_tables_raises_on_permission_error pins that.

An empty list has real consequences in the callers:

  • MonitoringService calls _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_job returns None for [], and update_status returns early when the job is None. 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", ...}), on master: query_monitoring_metrics(...) returns [] and nothing is raised. The same for SYNTAX_ERROR and GENERIC_INTERNAL_ERROR.

Change

TABLE_NOT_FOUND and SCHEMA_NOT_FOUND still return [], since either means the monitoring table has not been created yet. Any other TrinoQueryError is logged and re-raised, the same as in ensure_monitoring_tables.

Verification

Two new tests in test_trino_monitoring.py. One covers SCHEMA_NOT_FOUND returning []. The other, parametrized over ACCESS_DENIED, SYNTAX_ERROR and GENERIC_INTERNAL_ERROR, checks that the error is raised. On master the 3 parametrized cases fail and the 2 not-found cases pass, including the existing TABLE_NOT_FOUND test. With the change, the Trino offline store tests are 28 passed. ruff check and ruff format --check are clean.

Which issue(s) this PR fixes:

None filed. The reproduction is above. This follows the Trino monitoring support added in #6779.

Checks

  • I've made sure the tests are passing.
  • My commits are signed off (git commit -s)
  • My PR title follows conventional commits format

Testing Strategy

  • Unit tests
  • Integration tests
  • Manual tests
  • Testing is not required for this change

@ericdelorefice
ericdelorefice requested a review from a team as a code owner October 1, 2026 09:09
@codecov-commenter

codecov-commenter commented Oct 1, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.50%. Comparing base (fe27230) to head (cb584b6).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
...ffline_stores/contrib/trino_offline_store/trino.py 0.00% 4 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files

Impacted file tree graph

@@            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              
Flag Coverage Δ
go-feature-server 30.58% <ø> (ø)
python-unit 49.87% <0.00%> (-0.01%) ⬇️
Files with missing lines Coverage Δ
...ffline_stores/contrib/trino_offline_store/trino.py 38.34% <0.00%> (-0.22%) ⬇️

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fe27230...cb584b6. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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
ntkathole force-pushed the trino-monitoring-errors branch from cd3265e to cb584b6 Compare October 1, 2026 12:33
@ntkathole
ntkathole merged commit 6161766 into feast-dev:master Oct 1, 2026
19 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants