Update engineError conditionally based on engineError or engineId presence#7320
Open
turboFei wants to merge 1 commit intoapache:masterfrom
Open
Update engineError conditionally based on engineError or engineId presence#7320turboFei wants to merge 1 commit intoapache:masterfrom
turboFei wants to merge 1 commit intoapache:masterfrom
Conversation
### Why are the changes needed? In the previous commit [KYUUBI apache#7313], when a k8s application is pending, we audit the app diagnostics to record the pending reason. This information is eventually updated to the `engineError` field in the metadata store via the `updateMetadata` method. However, when the application transitions from pending to finished successfully, if there is no error (i.e., `engineError` is `None`), the old pending reason remains in the metadata, causing confusion. ### What are the changes? Modified `JDBCMetadataStore.updateMetadata()` to conditionally update the `engineError` field: - Previously: Only updated when `engineError` was `Some(error)` - Now: Updates when either: 1. `engineError` is defined (Some), OR 2. `engineId` is defined (indicating app has been launched) This ensures that: - Pending reasons are properly cleared when the application transitions to success (engineId is set) - engineError won't be updated unnecessarily when neither engineError nor engineId is present in the update ### How was this patch tested? - Enhanced unit test `update engineError conditionally based on engineError or engineId presence` in `JDBCMetadataStoreSuite` - The test verifies three scenarios: 1. Setting engineError when it's defined works correctly 2. Clearing engineError when engineId is defined (even if engineError is None) 3. engineError remains unchanged when neither engineError nor engineId is in the update 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7320 +/- ##
======================================
Coverage 0.00% 0.00%
======================================
Files 698 698
Lines 43656 43656
Branches 5896 5897 +1
======================================
Misses 43656 43656 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
pan3793
reviewed
Feb 9, 2026
| } | ||
| metadata.engineError.foreach { error => | ||
| // Update engineError when it's defined or when engineId is defined | ||
| // This ensures pending reasons are cleared when app transitions to success |
Member
There was a problem hiding this comment.
... when app transitions to success
the code does not reflect the condition. is there a chance that the batch transfers to another negative state and clears the error message?
Member
Author
There was a problem hiding this comment.
K8S App:
Pending (appError=Some("reason")) -> FINISHED (appError = None), and then the pending reason is stored in the metadata store.
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.
Why are the changes needed?
In the previous commit [KYUUBI #7313], when a k8s application is pending, we audit the app diagnostics to record the pending reason. This information is eventually updated to the
engineErrorfield in the metadata store via theupdateMetadatamethod.However, when the application transitions from pending to finished successfully, if there is no error (i.e.,
engineErrorisNone), the old pending reason remains in the metadata, causing confusion.What are the changes?
Modified
JDBCMetadataStore.updateMetadata()to always update theengineErrorfield:engineErrorwasSome(error)nullwhenengineErrorisNoneThis ensures that pending reasons are properly cleared when the application state changes.
How was this patch tested?
update engineError to null when it becomes NoneinJDBCMetadataStoreSuiteWas this patch authored or co-authored using generative AI tooling?
🤖 Generated with Claude Code