8000 Do not report clustered caches without configuration in the server info by costa-chown · Pull Request #55573 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Do not report clustered caches without configuration in the server info - #55573

Open
costa-chown wants to merge 1 commit into
keycloak:mainfrom
costa-chown:fix/55572-login-failures-server-info
Open

costa-chown wants to merge 1 commit into
keycloak:mainfrom
costa-chown:fix/55572-login-failures-server-info

Conversation

@costa-chown
Copy link
Copy Markdown

Closes #55572

login-failures:v2 (default) removes the loginFailures cache, and stateless removes all clustered caches but work. addEmbeddedOperationalInfo still asked Infinispan for the health of every name in CLUSTERED_CACHE_NAMES. Infinispan answers with InvalidCacheHealth for a cache it does not know, whose status is always FAILED, so the server info (admin console: Realm info → Provider info → connectionsInfinispan) showed loginFailures:Cache: FAILED on a healthy cluster.

Only caches with a configuration are reported now (cacheManager::cacheConfigurationExists, as addShutdownListeners already does). The status of the other caches is unchanged.

Tests

  • New unit test EmbeddedOperationalInfoTest: all clustered caches but loginFailures defined; loginFailures is not reported, the others are HEALTHY, no value is FAILED. It fails without the change.
  • ServerInfoTest: no value of connectionsInfinispan is FAILED.
  • Checked by hand on 26.8.1 with the change applied (three instances, jdbc-ping): the server info lists the seven other caches as HEALTHY with clusterSize: 3 and no loginFailures entry; before, loginFailures:Cache was FAILED with one and with three instances.

login-failures:v2 removes the loginFailures cache and stateless removes all
clustered caches but work. addEmbeddedOperationalInfo still asked Infinispan
for their health, and Infinispan reports a cache it does not know as FAILED,
so the server info showed loginFailures:Cache FAILED on a healthy cluster.
Only caches with a configuration are reported now.

Closes keycloak#55572

Signed-off-by: Konstantin Kauz <konstantin.kauz@opendefense.cloud>
Copilot AI 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.

🟢 Approval recommended

No active review issues are reported for the change excluding unconfigured embedded caches from server info.

No open issues 🎉

What changed in this PR

Fixes #55572 by excluding unconfigured embedded caches from server info, preventing misleading FAILED statuses when features such as login-failures:v2 or stateless remove caches.

Changes:

  • Filters clustered cache names by configuration existence before requesting health.
  • Adds unit coverage for omitted caches and healthy configured caches.
  • Extends the server-info integration test to reject FAILED operational values.
File Description
tests/​base/​src/​test/​java/​org/​keycloak/​tests/​admin/​ServerInfoTest.java Checks that Infinispan operational info contains no FAILED values.
model/​infinispan/​src/​test/​java/​org/​keycloak/​connections/​infinispan/​EmbeddedOperationalInfoTest.java Verifies unconfigured loginFailures is omitted while configured caches remain healthy.
model/​infinispan/​src/​main/​java/​org/​keycloak/​connections/​infinispan/​DefaultInfinispanConnectionProviderFactory.java Filters unconfigured caches and extracts a package-private helper for testing.

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet
4A53

Development

Successfully merging this pull request may close these issues.

Server info reports loginFailures cache as FAILED when login-failures:v2 is enabled

2 participants

0