Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ on:
- tagscanarymerge
- fixlabels
- interceptapis
- mlh-1240-custom-metadata-consistency
- mlh-1199-fix

jobs:
build:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
import org.springframework.stereotype.Component;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.micrometer.core.instrument.Gauge;
import io.micrometer.core.instrument.MeterRegistry;

import javax.annotation.PostConstruct;
import javax.inject.Inject;
Expand Down Expand Up @@ -80,15 +78,6 @@ public void initialize() throws InterruptedException {
preloadAllFlags();
initialized = true;

// Add version tracking metric
MeterRegistry meterRegistry = org.apache.atlas.service.metrics.MetricUtils.getMeterRegistry();
Gauge.builder(METRIC_COMPONENT + "_atlas_version_enabled",
this,
ref -> isTagV2Enabled() ? 2.0 : 1.0)
.description("Indicates which Tag propagation version is enabled (2.0 = v2, 1.0 = v1)")
.tag("component", "version")
.register(meterRegistry);

long duration = System.currentTimeMillis() - startTime;
LOG.info("FeatureFlagStore initialization completed successfully in {}ms", duration);
break; // Success! Exit the loop.
Expand All @@ -106,10 +95,6 @@ public void initialize() throws InterruptedException {
private void validateDependencies() {
LOG.info("Validating FeatureFlagStore dependencies...");
try {
if (redisService instanceof NoRedisServiceImpl) {
return;
}

// Test Redis connectivity with a simple operation
String testKey = "ff:_health_check";
redisService.putValue(testKey, "test");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import javax.annotation.PostConstruct;

@Component("redisServiceImpl")
@Component()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Spring Bean Naming Issue Affects Dependency Injection

Removing the explicit redisServiceImpl bean name from the @Component annotation in NoRedisServiceImpl and RedisServiceLocalImpl causes Spring dependency injection to fail. FeatureFlagStore relies on @DependsOn("redisServiceImpl"), but no bean with that name is now registered.

Additional Locations (1)

Fix in Cursor Fix in Web

@ConditionalOnAtlasProperty(property = "atlas.redis.service.impl", isDefault = true)
public class NoRedisServiceImpl extends AbstractRedisService {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public void init() throws InterruptedException {
redisClient = Redisson.create(getProdConfig());
redisCacheClient = Redisson.create(getCacheImplConfig());

LOG.info("Redis Client created!!!");

if (redisClient == null || redisCacheClient == null) {
throw new AtlasException("Failed to create Sentinel redis client.");
}
Expand All @@ -43,7 +45,7 @@ public void init() throws InterruptedException {
break;
} catch (Exception e) {
LOG.warn("Redis connection failed: {}. Application startup is BLOCKED. Retrying in {} seconds...", e.getMessage(), RETRY_DELAY_MS / 1000);
MetricUtils.recordRedisConnectionFailure();
//MetricUtils.recordRedisConnectionFailure();
// Clean up any partially created clients before retrying.
shutdownClients();
Thread.sleep(RETRY_DELAY_MS);
Expand All @@ -60,7 +62,7 @@ private void testRedisConnectivity() throws Exception {

try {
// Test cache client
LOG.debug("Testing Redis cache client connectivity");
LOG.info("Testing Redis cache client connectivity");
redisCacheClient.getBucket(testKey).set(testValue);
String retrievedValue = (String) redisCacheClient.getBucket(testKey).get();

Expand All @@ -69,10 +71,10 @@ private void testRedisConnectivity() throws Exception {
}

redisCacheClient.getBucket(testKey).delete();
LOG.debug("Redis connectivity test completed successfully");
LOG.info("Redis connectivity test completed successfully");

} catch (Exception e) {
MetricUtils.recordRedisConnectionFailure();
//MetricUtils.recordRedisConnectionFailure();
throw new Exception("Redis connectivity test failed", e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import javax.annotation.PostConstruct;

@Component("redisServiceImpl")
@Component()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Spring Bean Naming Conflict Causes Startup Failure

Removing the explicit bean name "redisServiceImpl" from @Component breaks dependency resolution for FeatureFlagStore. FeatureFlagStore uses @DependsOn("redisServiceImpl"), but Spring now defaults the bean name to "redisServiceLocalImpl", causing application startup to fail.

Fix in Cursor Fix in Web

@ConditionalOnAtlasProperty(property = "atlas.redis.service.impl")
public class RedisServiceLocalImpl extends AbstractRedisService {

Expand Down
Loading