OSIS-156: log empty bucket list at DEBUG, not as a failure#164
Conversation
A tenant with no buckets is an expected, recoverable condition: the storage platform answers with a 404/error and getBucketList returns an empty list. OSIS-163 already dropped the full stack trace and lowered the recovery log from ERROR to WARN; this lowers it further to DEBUG with a concise message so the normal 'no buckets yet' case no longer reads as a warning. The empty-list contract is unchanged. Adds a ListAppender regression test asserting the empty-bucket case returns an empty page and is never logged at ERROR or WARN and carries no stack trace.
|
…ected 404 to DEBUG
|
Blocking issue — wrong exception type makes the fix a no-op in production.
Fix: change the Review by Claude Code |
|
Addressed in 2dd1765: narrowed the DEBUG path to the expected case (S3ServiceException with NOT_FOUND status) and kept WARN for genuine Vault/S3/network/auth faults, so real failures stay visible to operators while the empty-page contract is unchanged. Added testGetBucketListGenuineFaultLogsAtWarn to cover the genuine-fault path; the existing empty-list test still asserts DEBUG-only. Thanks for the catch. |
|
LGTM — well-scoped change. The logic correctly distinguishes a 404 (expected empty-bucket case) from other faults, the empty-page contract is preserved on both paths, and the two new tests cover both branches with log-level assertions. One minor note left inline about getStatus() deprecation for the eventual Boot 3 migration. |
…s throws), not S3ServiceException; mocks now match production
|
LGTM — clean, well-scoped change. The exception split is correct: |
|
Superseded by #167, which re-creates this change minimally on top of main (and keeps genuine bucket-list faults at ERROR with their trace; only the expected empty case is quieted). Closing this one. |
Intent: why does this change exist?
When a tenant legitimately has no buckets, the platform answers with a 404/error and OSIS recovers to an empty list. That expected case was still logged as a failure (WARN after OSIS-163, ERROR with a full stack before it), which reads as a problem to operators when nothing is wrong.
System impact: what's affected, including downstream?
One catch block in getBucketList in osis-core. Only the log level and message change; the returned response and HTTP behavior are identical, so OSE sees no difference.
Preserved behavior: what explicitly stays the same?
getBucketList still returns an empty PageOfOsisBucketMeta with the same pageInfo on the recovery path. The happy path is untouched. A genuine fault still surfaces through the returned empty page exactly as before.
Intended change: what's different after this PR?
The empty-bucket recovery is logged at DEBUG with a concise message instead of WARN, and continues to carry no stack trace. Adds a ListAppender regression test asserting the empty case returns an empty page and is never logged at ERROR or WARN nor dumps a stack.
Verification: how do we know this worked, or how would we know if it didn't?
Ran
./gradlew :osis-core:test jacocoTestCoverageVerification: all tests pass and coverage stays above the 75% gate. The new test fails if the recovery log returns to WARN/ERROR or starts carrying a stack trace.