Skip to content

[To master] Avoid stack traces for expected REST query errors - #19281

Merged
JackieTien97 merged 2 commits into
masterfrom
ty/cp-19280-master
Nov 15, 2026
Merged

JackieTien97 merged 2 commits into
masterfrom
ty/cp-19280-master

Conversation

@JackieTien97

Copy link
Copy Markdown
Contributor

Cherry-pick #19280 (merged commit e986397) from dev/1.3 onto master, based on e78f736.

REST v1 and v2 currently log WARN stack traces for expected query failures. Share the query logging policy from ErrorHandlingUtils with both handlers. For example, a ParseCancellationException("invalid SQL") still returns SQL_PARSE_ERROR and the same message, but now produces INFO without a stack trace. STORAGE_ENGINE_NOT_READY remains silent, while unexpected failures retain WARN stack traces.

Adapt the handlers and parameterized tests to master's external-service-impl/rest module and current exception packages. Preserve master's complete expected-error classification (including LBAC, table/column, and metadata lease errors) and existing localized message template. The regression tests also cover master-specific status codes.

Validation with JDK 17:

  • mvn clean test -pl external-service-impl/rest -am -Dtest=ExceptionHandlerTest,ErrorHandlingUtilsTest -Dsurefire.failIfNoSpecifiedTests=false -DfailIfNoTests=false: passed, 12 tests, no failures/errors/skips.
  • mvn test-compile -DskipTests: passed.
  • mvn test-compile -DskipTests -P with-zh-locale: passed.
  • Spotless and git diff --check: passed.

Cherry-pick #19280 from dev/1.3. Adapt REST module/package locations and preserve the existing master query error classification and localized message template.

(cherry picked from commit e986397)
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@codecov

codecov Bot commented Nov 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.50000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 49.21%. Comparing base (e78f736) to head (92c8835).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
.../org/apache/iotdb/db/utils/ErrorHandlingUtils.java 97.36% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #19281      +/-   ##
============================================
+ Coverage     49.16%   49.21%   +0.04%     
- Complexity      689      699      +10     
============================================
  Files          5593     5593              
  Lines        414614   414717     +103     
  Branches      54755    54769      +14     
============================================
+ Hits         203841   204085     +244     
+ Misses       210773   210632     -141     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@JackieTien97
JackieTien97 merged commit ea7b4ff into master Nov 15, 2026
41 of 42 checks passed
@JackieTien97
JackieTien97 deleted the ty/cp-19280-master branch November 15, 2026 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant