Skip to content

Dependency fixes#23

Merged
aimansharief merged 8 commits intomasterfrom
dependency-fixes
Mar 23, 2026
Merged

Dependency fixes#23
aimansharief merged 8 commits intomasterfrom
dependency-fixes

Conversation

@aimansharief
Copy link
Copy Markdown
Owner

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.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

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

  • Ran Test A
  • Ran Test B

Test Configuration:

  • Software versions: Java 11, scala-2.12, play-2.7.2
  • Hardware versions: 2 CPU/ 4GB RAM

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

chethann007 and others added 8 commits March 19, 2026 09:20
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>
- 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
@aimansharief aimansharief merged commit 749f9c3 into master Mar 23, 2026
11 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants