Skip to content

OSIS-166: preserve Vault server faults (5xx), map other create/update failures to 400 - #169

Merged
anurag4DSB merged 1 commit into
mainfrom
bugfix/OSIS-166-preserve-vault-5xx-status-mainport
Jun 29, 2026
Merged

OSIS-166: preserve Vault server faults (5xx), map other create/update failures to 400#169
anurag4DSB merged 1 commit into
mainfrom
bugfix/OSIS-166-preserve-vault-5xx-status-mainport

Conversation

@anurag4DSB

Copy link
Copy Markdown
Contributor

Intent: why does this change exist?

Several create and update methods caught any failure and rethrew it as 400 BAD_REQUEST, which masked a genuine Vault server fault (5xx) as a client error and hid real outages behind a misleading status.

System impact: what's affected, including downstream?

The error status surfaced by createTenant, createUser, createS3Credential, updateTenant, updateCredentialStatus, and updateUser. VaultServiceException extends Spring's ResponseStatusException, so the carried status is what the caller sees.

Preserved behavior: what explicitly stays the same?

Client-side rejections still map to 400 with the original kept as the cause (updateTenant keeps its errorCode and reason), and all existing error logging is unchanged. Only genuine 5xx faults change.

Intended change: what's different after this PR?

A VaultServiceException carrying a 5xx status is rethrown unchanged so the real server status reaches the caller, instead of being downgraded to 400. A small toResponseException helper centralizes the rule; updateTenant gets an inline 5xx passthrough to keep its errorCode and reason contract. Tests pin that a 500 from Vault stays 500 on create and update.

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 JaCoCo gate: green. The new tests fail if a Vault 5xx is downgraded to 400.

@claude

claude Bot commented Jun 26, 2026

Copy link
Copy Markdown

LGTM — the 5xx passthrough logic is correct. The toResponseException helper properly checks for VaultServiceException with a 5xx status before falling back to 400, and the inline variant in updateTenant correctly preserves errorCode/reason for 4xx while still surfacing genuine server faults. Tests pin both create and update paths.

Review by Claude Code

@anurag4DSB
anurag4DSB marked this pull request as ready for review June 26, 2026 10:26
@anurag4DSB
anurag4DSB requested a review from a team as a code owner June 26, 2026 10:26
Comment thread osis-core/src/main/java/com/scality/osis/service/impl/ScalityOsisServiceImpl.java Outdated
@anurag4DSB
anurag4DSB force-pushed the bugfix/OSIS-166-preserve-vault-5xx-status-mainport branch from a31ebe2 to 181c13c Compare June 29, 2026 10:59
@anurag4DSB
anurag4DSB force-pushed the bugfix/OSIS-166-preserve-vault-5xx-status-mainport branch from 181c13c to 7b51d03 Compare June 29, 2026 11:03
@anurag4DSB anurag4DSB changed the title OSIS-166: preserve Vault server faults (5xx) instead of masking them as 400 OSIS-166: preserve Vault server faults (5xx), map other create/update failures to 400 Jun 29, 2026
@anurag4DSB
anurag4DSB merged commit 6e83821 into main Jun 29, 2026
7 checks passed
@anurag4DSB
anurag4DSB deleted the bugfix/OSIS-166-preserve-vault-5xx-status-mainport branch June 29, 2026 11:07
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