fix(jans-fido2): avoid spurious cluster ConfigurationException in metrics aggregation#14222
fix(jans-fido2): avoid spurious cluster ConfigurationException in metrics aggregation#14222imran-ishaq wants to merge 1 commit into
Conversation
…rics aggregation Signed-off-by: imran <imranishaq7071@gmail.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|



Prepare
fix(jans-fido2): avoid spurious cluster ConfigurationException in metrics aggregation
Description
Target issue
closes #14221
Implementation Details
Single-node FIDO2 deployments logged an
io.jans.exception.ConfigurationException: ou=node is not configured in static configuration of AS (jansConfStatic).with a full stack trace on every metrics aggregation run (hourly/daily/weekly/monthly), making a healthy deployment look broken.Root cause:
Fido2MetricsAggregationScheduler.initializeClusterEnvironment()flagged the deployment as a cluster whenever theFido2ClusterNodeServiceCDI bean was present — which is always, since it is@ApplicationScoped. But cluster coordination requiresou=nodeinjansConfStatic, which is absent in the default single-node setup. Every cluster call (getClusterNodesLive()viastartPeriodicLockUpdates()) then threw the exception, which was logged at ERROR level with a full stack trace. Aggregation still completed via existing fallbacks, so this was misleading log noise rather than a functional failure.Fix:
initializeClusterEnvironment()now checksgetBaseClusterNodeDn()up front. Ifou=nodeis unconfigured (blank), it runs in single-node mode and never makes cluster calls, so the exception is never thrown. It emits a clean INFO line:FIDO2 metrics aggregation in SINGLE-NODE mode (ou=node not configured).startPeriodicLockUpdates()now logs a concise one-linewarn(message only) instead oferrorwith a full stack trace, since the single-node fallback already handles the condition gracefully.No functional change: cluster deployments (with
ou=nodeconfigured) keep full distributed locking exactly as before; single-node deployments produce the same aggregation result, just without the misleading stack trace. Only one file changed:jans-fido2/server/src/main/java/io/jans/fido2/service/metric/Fido2MetricsAggregationScheduler.java.Test and Document the changes
Please check the below before submitting your PR. The PR will not be merged if there are no commits that start with
docs:to indicate documentation changes or if the below checklist is not selected.