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

cells: ignore empty core domain uris propagated by zk #7699

Merged
merged 1 commit into from
Nov 21, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public CoreDomainInfo(byte[] bytes) {
}
} catch (IOException ie) {
throw new IllegalArgumentException(
"Failed deserializing LocationManager Cores as uri: {}", ie.getCause());
"Failed deserializing LocationManager Cores as uri", ie);
}
}

Expand Down Expand Up @@ -513,6 +513,10 @@ public void close() {
public void reset(Mode mode, State state) {
}

private boolean hasNoData(ChildData data) {
return data == null || data.getData() == null || data.getData().length == 0;
}

public void update(PathChildrenCacheEvent event) {
LOGGER.info("{}", event);
String cell;
Expand All @@ -525,12 +529,22 @@ public void update(PathChildrenCacheEvent event) {
}
break;
case CHILD_UPDATED:
cell = connectors.remove(ZKPaths.getNodeFromPath(event.getData().getPath()));
if (hasNoData(event.getData())) {
LOGGER.warn("Ignoring empty data on UPDATED for {}", event.getData().getPath());
break;
}
cell = connectors.remove(
ZKPaths.getNodeFromPath(event.getData().getPath()));
if (cell != null) {
killConnector(cell);
}
// fall through
case CHILD_ADDED:
if (hasNoData(event.getData())) {
LOGGER.warn("Ignoring empty data on ADDED for {}", event.getData().getPath());
break;
}

//Log if the Core Domain Information received is incompatible with previous
CoreDomainInfo info = infoFromZKEvent(event);
String domain = ZKPaths.getNodeFromPath(event.getData().getPath());
Expand Down