8000 Asynchronous server initialization by pruivo · Pull Request #47234 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Asynchronous server initialization - #47234

Merged
ahus1 merged 4 commits into
keycloak:mainfrom
pruivo:t_47187_async_boot
Mar 19, 2026
Merged

ahus1 merged 4 commits into
keycloak:mainfrom
pruivo:t_47187_async_boot

Conversation

@pruivo
@pruivo pruivo commented Mar 17, 2026 •
Copy link
Copy Markdown
Member

Closes #47187

  • New CLI option --server-async-bootstrap to disable this behavior if desired.
    • New category SERVER for this option, I don't think it fits the existing ones.
  • This behavior is documented in the section "Configuring Keycloak for production."
  • I didn't mention this behavior change in "breaking changes" but only in "notable changes". I want users to try this out.

@pruivo
pruivo requested review from shawkins March 17, 2026 18:20
@pruivo
pruivo marked this pull request as ready for review March 17, 2026 18:20
@pruivo
pruivo requested review from a team as code owners March 17, 2026 18:20
@pruivo
pruivo commented Mar 17, 2026
Copy link
Copy Markdown
Member Author

@shawkins, when you have free time, could you review this one, please? Thank you.

Comment on lines +57 to +59
By default, {project_name} opens its HTTP(S) and Management endpoints while initialization is still in progress in the background.
This means the server starts accepting TCP connections before it is fully ready to handle requests.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd say there should be some additional rationale explaining why this is a good thing: A potentially long running initialization or migration will then return on the health endpoints "up" for startup and liveness, and "down" for readiness.

@ahus1
ahus1 commented Mar 17, 2026
Copy link
Copy Markdown
Member

The docs on https://www.keycloak.org/nightly/observability/health might need updating listing the new health check, and also explaining that the management endpoint should be watched before sending traffic to the main port.

@ahus1 ahus1 mentioned this pull request Mar 17, 2026
@ahus1
ahus1 commented Mar 17, 2026
Copy link
Copy Markdown
Member

I've created a PR with some minor suggestions, see pruivo#13

The minimal human readable response should help users to not see a blank screen, but at least some message. And it would automatically refresh, so people wouldn't be stuck on that page.

@pruivo
pruivo commented Mar 17, 2026 •
Copy link
Copy Markdown
Member Author

I've created a PR with some minor suggestions, see pruivo#13

The minimal human readable response should help users to not see a blank screen, but at least some message. And it would automatically refresh, so people wouldn't be stuck on that page.

Sure. I had a text in the PoC, but I ended up removing it since users/admins have the CLI option to control the behavior they want.
I've applied your suggestion.

Edit: I'll do the docs change tomorrow morning.

@shawkins shawkins left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not sure what order the commits wil go in, but there will be some conflicts with #46918

pruivo and others added 4 commits March 18, 2026 14:52
Closes keycloak#47187

Signed-off-by: Pedro Ruivo <1492066+pruivo@users.noreply.github.com>
Signed-off-by: Alexander Schwartz <alexander.schwartz@ibm.com>
Signed-off-by: Pedro Ruivo <1492066+pruivo@users.noreply.github.com>
Co-authored-by: Steven Hawkins <shawkins@redhat.com>
Signed-off-by: Pedro Ruivo <pruivo@users.noreply.github.com>
@pruivo
pruivo force-pushed the t_47187_async_boot branch from 0e3658f to cc8bd76 Compare March 18, 2026 14:56
@pruivo
pruivo commented Mar 18, 2026
Copy link
Copy Markdown
Member Author

Not sure what order the commits will go in, but there will be some conflicts with #46918

For sure! I don't mind having this PR on hold and handling the conflicts here if it makes life easier for you.

@shawkins shawkins left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thanks @pruivo

@ahus1
ahus1 commented Mar 19, 2026
Copy link
Copy Markdown
Member

Not merging yet, as I understand you want to wait until #46918 is merged.

@shawkins
Copy link
Copy Markdown
Contributor

Not merging yet, as I understand you want to wait until #46918 is merged.

I'm okay to have this one go first as noone has reviewed #46918 yet.

@ahus1
ahus1 merged commit c93b6a7 into keycloak:main Mar 19, 2026
88 checks passed
@pruivo
pruivo deleted the t_47187_async_boot branch March 19, 2026 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Asynchronous server initialization

4 participants

0