Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allegro-internal/flex-roadmap#804 Added/removed logs #431

Merged
merged 1 commit into from
Sep 17, 2024
Merged
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
Lists all changes with user impact.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

## [0.21.1]
### Changed
- Added additional logs to SimpleCache

## [0.21.0]
### Changed
- Added `paths` field in API to support Glob Patterns
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Copy link
Collaborator

Choose a reason for hiding this comment

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

how will this help you with investigating the issue of removing snapshots with existing watches?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

snapshot is getting cleared when watch is removed and id of watch can be connected to the event when it was created while that one can be connected to events when instances of a services were changed, not sure if that will be enough, but right now there's literally nothing that can help debug it

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),
kozjan marked this conversation as resolved.
Show resolved Hide resolved
group,
version);
}
Expand Down Expand Up @@ -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);
}
kozjan marked this conversation as resolved.
Show resolved Hide resolved

respond(watch, snapshot, group);

Expand Down Expand Up @@ -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);
}
kozjan marked this conversation as resolved.
Show resolved Hide resolved

List<String> removedResources = snapshotRemovedResources.stream()
.filter(s -> watch.trackedResources().get(s) != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ public void invalidNamesListShouldReturnWatcherWithNoResponseInAdsMode() {
false,
false
);

assertThatWatchIsOpenWithNoResponses(new WatchAndTracker(watch, responseTracker));
}

Expand Down
Loading