Skip to content

OSIS-155: do not log the expected headTenant pre-create 404 as an error#166

Open
anurag4DSB wants to merge 1 commit into
mainfrom
improvement/OSIS-155-headtenant-precreate-404-log-mainport
Open

OSIS-155: do not log the expected headTenant pre-create 404 as an error#166
anurag4DSB wants to merge 1 commit into
mainfrom
improvement/OSIS-155-headtenant-precreate-404-log-mainport

Conversation

@anurag4DSB

Copy link
Copy Markdown
Contributor

Intent: why does this change exist?

During tenant activation OSE probes headTenant before the account exists, so the platform answers 404 and OSIS rethrows NotFoundException. The service logged that expected pre-create case at ERROR with a full stack trace, which reads as a fault during normal activation.

System impact: what's affected, including downstream?

Service-layer logging only, inside headTenant. No change to the HTTP response, the 404 contract, or any OSE/Vault interaction.

Preserved behavior: what explicitly stays the same?

headTenant still returns a 404 (NotFoundException) in every error scenario, as OSE requires. Only the spurious ERROR log line is removed.

Intended change: what's different after this PR?

The expected pre-create 404 is no longer logged as an error with a stack trace. A regression test pins that the service emits no ERROR or WARN and no stack trace for that path while still throwing NotFoundException.

Verification: how do we know this worked, or how would we know if it didn't?

Ran the full osis-core test module including the 75% JaCoCo gate: green. The new test fails if anything reintroduces an ERROR or stack-trace log for the expected pre-create 404.

@claude

claude Bot commented Jun 26, 2026

Copy link
Copy Markdown
  • ScalityOsisServiceImpl.java:912 — The blanket catch (Exception e) now silently swallows ALL exceptions, not just the expected pre-create VaultServiceException(404). Unexpected errors (NPE, network failures) lose their diagnostic logging. Suggest catching NotFoundException separately to rethrow as-is, and only suppressing the log for VaultServiceException while keeping logger.error for truly unexpected exception types.

Review by Claude Code

@anurag4DSB anurag4DSB force-pushed the improvement/OSIS-155-headtenant-precreate-404-log-mainport branch from f234bdb to 0f149e6 Compare June 26, 2026 10:15
@anurag4DSB

Copy link
Copy Markdown
Contributor Author

Addressed in 0f149e6. The catch now distinguishes the expected pre-create not-found (a NotFoundException, or a VaultServiceException with a 404 status) from genuinely unexpected failures: the expected case logs at DEBUG with no stack trace, while anything else (NPE, network, a Vault 5xx, etc.) still logs at ERROR with its stack trace so it stays diagnosable. The headTenant "404 for any error" contract OSE relies on is unchanged. Added a regression test (testHeadTenantUnexpectedErrorIsLoggedAtError) pinning that an unexpected fault is logged at ERROR with a trace while the caller still receives a 404.

@claude

claude Bot commented Jun 26, 2026

Copy link
Copy Markdown

LGTM — the logging change is clean and well-tested. The expectedNotFound discriminator correctly separates the pre-create 404 (NotFoundException and VaultServiceException with 404 status) from genuinely unexpected errors. Both branches are pinned by regression tests. No issues found.

Review by Claude Code

@anurag4DSB anurag4DSB marked this pull request as ready for review June 26, 2026 10:22
@anurag4DSB anurag4DSB requested a review from a team as a code owner June 26, 2026 10:22
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.

3 participants