diff --git a/CHANGELOG.md b/CHANGELOG.md index b9dd60d1b..f20435d91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ### Changed - Spring Boot update to 3.3.2 +## [0.21.1] +### Changed +- Added additional logs to SimpleCache + ## [0.21.0] ### Changed - Added `paths` field in API to support Glob Patterns diff --git a/envoy-control-core/src/main/java/pl/allegro/tech/servicemesh/envoycontrol/SimpleCache.java b/envoy-control-core/src/main/java/pl/allegro/tech/servicemesh/envoycontrol/SimpleCache.java index d75493edc..e1b66b0d8 100644 --- a/envoy-control-core/src/main/java/pl/allegro/tech/servicemesh/envoycontrol/SimpleCache.java +++ b/envoy-control-core/src/main/java/pl/allegro/tech/servicemesh/envoycontrol/SimpleCache.java @@ -268,12 +268,15 @@ public DeltaWatch createDeltaWatch( String version) { long watchId = watchCount.incrementAndGet(); status.setWatch(watchId, watch); - watch.setStop(() -> status.removeWatch(watchId)); + watch.setStop(() -> { + LOGGER.debug("removing watch {}", watchId); + status.removeWatch(watchId); + }); + if (LOGGER.isDebugEnabled()) { - LOGGER.debug("open watch {} for {}[{}] from node {} for version {}", + LOGGER.debug("open watch {} for {} from node {} for version {}", watchId, url, - String.join(", ", resources), group, version); } @@ -371,12 +374,6 @@ protected void respondWithSpecificOrder(T group, String version = snapshot.version(watch.request().getResourceType(), watch.request().getResourceNamesList()); if (!watch.request().getVersionInfo().equals(version)) { - if (LOGGER.isDebugEnabled()) { - LOGGER.debug("responding to open watch {}[{}] with new version {}", - id, - String.join(", ", watch.request().getResourceNamesList()), - version); - } respond(watch, snapshot, group); @@ -413,12 +410,6 @@ protected void respondWithSpecificOrder(T group, String version = snapshot.version(watch.request().getResourceType(), Collections.emptyList()); if (!watch.version().equals(version)) { - if (LOGGER.isDebugEnabled()) { - LOGGER.debug("responding to open watch {}[{}] with new version {}", - id, - String.join(", ", watch.trackedResources().keySet()), - version); - } List removedResources = snapshotRemovedResources.stream() .filter(s -> watch.trackedResources().get(s) != null) diff --git a/envoy-control-core/src/test/java/pl/allegro/tech/servicemesh/envoycontrol/v3/SimpleCacheTest.java b/envoy-control-core/src/test/java/pl/allegro/tech/servicemesh/envoycontrol/v3/SimpleCacheTest.java index 444b0bd38..4c32f4bc1 100644 --- a/envoy-control-core/src/test/java/pl/allegro/tech/servicemesh/envoycontrol/v3/SimpleCacheTest.java +++ b/envoy-control-core/src/test/java/pl/allegro/tech/servicemesh/envoycontrol/v3/SimpleCacheTest.java @@ -95,7 +95,6 @@ public void invalidNamesListShouldReturnWatcherWithNoResponseInAdsMode() { false, false ); - assertThatWatchIsOpenWithNoResponses(new WatchAndTracker(watch, responseTracker)); }