FINERACT-2738: Add warning when Idempotency-Key header is missing (config-gated) - #6228
Open
AshharAhmadKhan wants to merge 1 commit into
Conversation
Contributor
Author
|
hey @adamsaghy , please trigger checks whenever you are free please. |
AshharAhmadKhan
force-pushed
the
FINERACT-2738-Add-warning-when-Idempotency-Key-header-is-missing
branch
from
August 5, 2026 09:20
89fd28d to
52d06a6
Compare
Contributor
Author
|
hey @adamsaghy , failures looks flaky. Can you please retrigger checks when you get a chance, thankss. |
Contributor
Author
|
Hey @adamsaghy , I checked the failures again after the retrigger. These are unrelated to my changes. The OAuth2AuthenticationTest is failing on Shard 2, and this is nowhere related to my PR. Should we wait before retriggering, or is there something I'm missing here? |
Contributor
|
@AshharAhmadKhan When were you rebased this PR with latest |
Contributor
|
Based on the logs, there is no tenant context available when the idempotency filter is called: |
AshharAhmadKhan
force-pushed
the
FINERACT-2738-Add-warning-when-Idempotency-Key-header-is-missing
branch
from
August 5, 2026 14:26
52d06a6 to
77578cf
Compare
Contributor
Author
|
Thanks a lot @adamsaghy for your guidance, please let me know if you need any more changes. Thanks again. |
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.
JIRA
https://issues.apache.org/jira/browse/FINERACT-2738
Problem
When the Idempotency-Key header is missing on a request, it is processed silently. No log, no signal, no observability. This creates a risk of unintended duplicate command processing going unnoticed.
This was originally raised in FINERACT-2591, and an earlier attempt (PR #5873) implemented unconditional WARN logging. That approach was rejected in review, since it would spam logs for every client that does not use idempotency handling.
Fix
Added a new global configuration option, enable-idempotency-validation, disabled by default for backward compatibility.
When enabled, a WARN level log is emitted if the Idempotency-Key header is missing on a request. The flag is read through the cached global configuration service (ConfigurationDomainService), following the same pattern used elsewhere in the codebase.
No existing request processing behavior changes. This is observability only, and off by default.
Testing
Added IdempotencyStoreFilterTest covering all four branches: validation disabled, content type not allowed, header present, and header missing with validation enabled.