Commit 6c96ff8
[KYUUBI #7XXX] Always update engineError to clear pending reasons
### 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 `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 always update the `engineError` field:
- Previously: Only updated when `engineError` was `Some(error)`
- Now: Always updates, setting to `null` when `engineError` is `None`
This ensures that pending reasons are properly cleared when the application state changes.
### How was this patch tested?
- Added unit test `update engineError to null when it becomes None` in `JDBCMetadataStoreSuite`
- The test verifies that:
1. Setting engineError to a pending reason works correctly
2. Updating engineError to None clears the value in the database
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 2037881 commit 6c96ff8
File tree
2 files changed
+47
-4
lines changed- kyuubi-server/src
- main/scala/org/apache/kyuubi/server/metadata/jdbc
- test/scala/org/apache/kyuubi/server/metadata/jdbc
2 files changed
+47
-4
lines changedLines changed: 3 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
383 | 382 | | |
384 | 383 | | |
385 | 384 | | |
| |||
Lines changed: 44 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
274 | 318 | | |
275 | 319 | | |
276 | 320 | | |
| |||
0 commit comments