Merged
Conversation
Redis was previously a hard dependency — the connection pool was eagerly
initialized on startup and all cache reads were unconditional, causing
startup failures and runtime errors in environments without Redis.
Changes:
platform-core/RedisConnector:
- Made jedisPool lazy so it is only initialized when redis.enable=true
- getConnection returns null when Redis is disabled (no pool created)
- closePool() and shutdown hook are guarded by isEnabled
platform-core/RedisCache:
- Changed default of isRedisEnabled from true to false
- Added startup log clearly stating whether Redis is enabled or disabled
VersioningNode (node read cache):
- getCachedNode now short-circuits to DB when redis.enable=false
- Previously always attempted Redis.getAsync regardless of config
FrameworkValidator (framework category validation):
- Replaced synchronous Redis-only lookup with async DB fallback
- When redis.enable=false, reads category terms from graph DB directly
- When redis.enable=true, uses Redis cache with DB as fallback and saves result
- Added getCategoryTermsFromDB private method
- Fixed null-safe graphId resolution in getValidatedTerms to prevent
INVALID_GRAPH errors on visibility=Parent nodes with no graphId set
PropAsEdgeValidator (edge property validation):
- Replaced synchronous Redis-only lookup with async DB fallback
- When redis.enable=false, reads valid values from graph DB directly
- When redis.enable=true, uses Redis cache with DB as fallback and saves result
- Added getEdgeListFromDB private method
- Fixed null-safe graphId resolution to prevent INVALID_GRAPH errors
HealthCheckManager:
- Redis health check returns healthy=true (skipped) when redis.enable=false
- Prevents spurious health check failures in Redis-less environments
HierarchyManager:
- getPublishedHierarchy reads from Redis only when collection.cache.enable=true
- Falls back to Cassandra when cache is disabled
UpdateHierarchyManager:
- Fixed INVALID_GRAPH bug: visibility=Parent nodes deserialized from
Cassandra hierarchy had null graphId; added node.setGraphId("domain")
after NodeUtil.deserialize in addNodeToList
All application.conf files (content-api, assessment-api, taxonomy-api,
search-api, knowlg-service) and test configs:
- Added redis.enable = false as explicit default
- Set content.cache.enable, collection.cache.enable, framework.cache.read
to false so caching is opt-in via config override
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ects what was written to DB
- PropAsEdgeValidator, FrameworkValidator: forward setDefaultValue through all super.validate call sites (previously dropped, causing behavior change when false) - RedisConnector: replace lazy jedisPool with Option-backed synchronized def to avoid initializing pool during JVM shutdown; pool now created only on first getConnection - taxonomy-service application.conf: fix misleading comment referencing non-existent REDIS_ENABLE env var; document correct redis.enable config key
fix: Sync serialized values back so the returned node's metadata reflects what was written to DB
…nal-redis-config feat: make Redis optional - all cache paths fall back to DB when redis.enable=false
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.
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Type of change
Please choose appropriate options.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes in the below checkboxes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration:
Checklist: