[FRT-1629] Dedupe retryable statement errors and always surface a failure reason#3400
[FRT-1629] Dedupe retryable statement errors and always surface a failure reason#3400Natea Eshetu Beshada (nateab) wants to merge 1 commit into
Conversation
|
🎉 All Contributor License Agreements have been signed. Ready to merge. |
There was a problem hiding this comment.
Pull request overview
Improves confluent flink statement failure UX by reducing noisy repeated retryable error details during PENDING polling and ensuring terminal failures surface a meaningful reason (or a clear placeholder) along with an actionable suggestion.
Changes:
- Added
formatCapturedErrorsto de-duplicate repeated retryablestatus.detailmessages and use it at retry-limit and timeout exits. - Updated
WaitPendingStatement(cloud + on-prem) to always return a non-empty failure reason for terminal states and to include aSuggestion. - Updated/added unit tests to cover deduped output and FAILED-with-no-reason behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| pkg/flink/internal/store/store.go | Adds failure-reason placeholder + suggestion for terminal states; dedupes retryable errors via formatCapturedErrors. |
| pkg/flink/internal/store/store_onprem.go | Mirrors the terminal-state failure-reason placeholder + suggestion behavior for on-prem. |
| pkg/flink/internal/store/store_test.go | Updates retry-limit expectation; adds coverage for FAILED with no status.detail/exceptions and asserts Suggestion. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if statementStatus != types.COMPLETED && statementStatus != types.RUNNING { | ||
| failureMessage := updatedStatement.StatusDetail | ||
| if failureMessage == "" { | ||
| failureMessage = fmt.Sprintf("the server did not report a failure reason; run `confluent flink statement describe %s` for the full status", statement.StatementName) |
| if statementStatus != types.COMPLETED && statementStatus != types.RUNNING { | ||
| failureMessage := updatedStatement.StatusDetail | ||
| if failureMessage == "" { | ||
| failureMessage = fmt.Sprintf("the server did not report a failure reason; run `confluent flink statement describe %s` for the full status", statement.StatementName) |
|




Problem
confluent flinkstatement error output is confusing when a statement fails during the briefPENDINGwindow (surfaced viaCREATE FUNCTIONon an unsupported PTF state type, but general):status.detailis appended once per poll and printed N× — e.g.captured retryable errors: <msg>; <msg>; …alongsideexiting after 6 retries.FAILEDstatement with an emptystatus.detailprints a barecan't fetch results. Statement phase is: FAILEDwith no reason.Change (
pkg/flink/internal/store)formatCapturedErrorshelper — identical details collapse to a single line annotated(repeated N times); used at both the retry-limit and timeout exits.WaitPendingStatement: whenstatus.detailis empty (and no exceptions are available), emit a clear placeholder pointing atconfluent flink statement describe, plus an actionableSuggestion. Mirrored to the on-prem store.Tests
TestWaitForPendingHitsErrorRetryLimitfor the deduped output.TestWaitPendingStatementSetsPlaceholderWhenFailedWithNoReason.Suggestionassertions to the existing FAILED-branch tests.go test ./pkg/flink/internal/store/,gofmt, andgo vetclean locally.Context
The originally-suspected server-side "statement stuck ~2 min" behavior was investigated and measured on devel: deterministic UDF extraction errors already fast-fail (~15s) via the control-plane expire-now path, so no server-side change is needed. This PR addresses the residual CLI-output issue. Details in FRT-1629.
Refs FRT-1629.