Skip unnecessary provider initialization for non-server commands - #51511
Merged
Conversation
Closes keycloak#51506 Signed-off-by: Martin Bartoš <mabartos@redhat.com>
mabartos
marked this pull request as ready for review
August 6, 2026 12:56
mabartos
marked this pull request as draft
August 6, 2026 12:56
Contributor
There was a problem hiding this comment.
Pull request overview
Reduces startup work and timer-related logging for one-shot Keycloak commands.
Changes:
- Avoids creating or scheduling basic timers in non-server mode.
- Skips workflow listener setup and Infinispan session expiration tasks.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
BasicTimerProviderFactory.java |
Avoids timer creation. |
BasicTimerProvider.java |
Ignores scheduling without a timer. |
WorkflowsEventListenerFactory.java |
Skips post-initialization work. |
InfinispanUserSessionProviderFactory.java |
Skips offline-session expiration task startup. |
mabartos
marked this pull request as ready for review
August 7, 2026 11:55
Member
Author
|
@shawkins Could you please check it? Thank you! |
shawkins
approved these changes
Aug 7, 2026
michalvavrik
approved these changes
Aug 7, 2026
mabartos
commented
Aug 10, 2026
| * Start the expiration task for offline sessions. | ||
| * Skipped in non-server mode (export, import) as session expiration is not needed for one-time commands. | ||
| */ | ||
| private void startExpirationTask(KeycloakSessionFactory factory) { |
Member
Author
There was a problem hiding this comment.
@keycloak/sre @pruivo @ryanemerson Can somebody from the PR team review this small change to cover the ISPN? Thanks!
pruivo
approved these changes
Aug 10, 2026
rmartinc
approved these changes
Aug 10, 2026
rmartinc
left a comment
Contributor
There was a problem hiding this comment.
Approving based on previous reviews.
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.
And these timers are skipped for the non-server command: