8000 Avoid NPE when reading flow executions during concurrent sub-flow creation by flipcyde101 · Pull Request #55800 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Avoid NPE when reading flow executions during concurrent sub-flow creation - #55800

Draft
flipcyde101 wants to merge 1 commit into
keycloak:mainfrom
flipcyde101:fix/flow-executions-npe-55794
Draft

flipcyde101 wants to merge 1 commit into
keycloak:mainfrom
flipcyde101:fix/flow-executions-npe-55794

Conversation

@flipcyde101
Copy link
Copy Markdown

Closes #55794

Under READ COMMITTED isolation, CachedRealm could load a newly committed sub-flow execution after snapshotting authentication flows, leaving a dangling flowId reference that caused recurseExecutions to dereference a null AuthenticationFlowModel.

Decisions and assumptions:

  • Populate CachedRealm.authenticationFlows before loading executions and skip sub-flow executions whose referenced flow is absent from the snapshot so readers see a consistent pre-change view.
  • Guard recurseExecutions against a null flowRef before incrementing the execution index so uncached reads or concurrent sub-flow deletions also avoid NPEs while preserving contiguous indices.

An AI coding agent assisted in investigating this issue and writing the fix and unit tests.

…ation

Closes keycloak#55794

Signed-off-by: Flipcyde <169501444+flipcyde101@users.noreply.github.com>
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.

NPE (HTTP 500) in GET /authentication/flows/{alias}/executions while a sub-flow is being added to the same flow

1 participant

0