Skip to content

Commit

Permalink
ENHANCE: Moved cache list change logic from IO thread to CacheManger …
Browse files Browse the repository at this point in the history
…thread.
  • Loading branch information
brido4125 committed Mar 20, 2024
1 parent 1fcd2d7 commit e2b1a9e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
11 changes: 11 additions & 0 deletions src/main/java/net/spy/memcached/CacheManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,17 @@ public void run() {
waitBeforeRetryMonitorCheck(1000L - elapsed);
}
}

// Handling cacheList changes to a MemcachedConnection resulting
// from the processing of a CacheMonitor's Watch event.
for (ArcusClient ac : getAC()) {
try {
ac.getMemcachedConnection().handleCacheNodesChange();
} catch (IOException e) {
getLogger().error("Cache List update error in ArcusClient {}, exception = {}",
ac.getName(), e.getCause());
}
}
}
}
getLogger().info("Close cache manager.");
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/net/spy/memcached/MemcachedConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,6 @@ public void handleIO() throws IOException {
}
/* ENABLE_REPLICATION end */

// Deal with the memcached server group that's been added by CacheManager.
handleCacheNodesChange();

if (!reconnectQueue.isEmpty()) {
attemptReconnects();
}
Expand Down

0 comments on commit e2b1a9e

Please sign in to comment.