Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

Incorrect code used return value#46318

Merged
ahus1 merged 2 commits intokeycloak:mainfrom
pruivo:t_46290
Feb 13, 2026
Merged

Incorrect code used return value#46318
ahus1 merged 2 commits intokeycloak:mainfrom
pruivo:t_46290

Conversation

@pruivo
Copy link
Member

@pruivo pruivo commented Feb 13, 2026

Fixes #46290

Copy link
Member

@ahus1 ahus1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your PR with this workaround! One curious question below.

if (data == null) {
return null;
}
return transaction.getCache().removeWithVersion(key, data.getVersion()) ?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious: Does removeWithVersion() work nicely in a retry? What does a remove-with-version do if the entry doesn't exist on the primary owner?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does what we do for embedded

var e = cache.getEntry(k)
if (e.version == expectedVersion)
  cache.remove(k, e.value)

@ahus1 ahus1 marked this pull request as ready for review February 13, 2026 14:59
@ahus1 ahus1 requested review from a team as code owners February 13, 2026 14:59
@ahus1 ahus1 merged commit 463ec1e into keycloak:main Feb 13, 2026
83 checks passed
@pruivo pruivo deleted the t_46290 branch February 13, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect code used error, leading to "400 / Code already used" during Infinispan state transfers

2 participants