Skip to content

Commit

Permalink
add proxy delete log
Browse files Browse the repository at this point in the history
  • Loading branch information
yifuzhou committed Sep 24, 2024
1 parent 99abb22 commit be6cf44
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ private void onInstanceStateChange(Object args) {
executors.execute(new AbstractExceptionLogTask() {
@Override
protected void doRun() throws Exception {
logger.debug("[onInstanceStateChange] {}", processor.getClass().getSimpleName());
processor.onEvent((AbstractInstanceEvent) args);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ public void onEvent(AbstractInstanceEvent event) {

@VisibleForTesting
protected void doOnEvent(AbstractInstanceEvent instanceSick) {
logger.info("[doOnEvent] {}", instanceSick.getInstance().getEndpoint());
ProxyTunnelInfo proxyTunnelInfo = findProxyTunnelInfo(instanceSick);
if (proxyTunnelInfo == null) {
logger.warn("[doOnEvent]proxy chain not found for {}", instanceSick);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,17 @@ public List<ProxyTunnelInfo> getAllProxyTunnels() {

@Override
public ProxyTunnelInfo getProxyTunnelInfo(String backupDcId, String clusterId, String shardId, String peerDcId) {
if (!clusterServer.amILeader()) return null;
return proxyTunnelInfos.get(new DcClusterShardPeer(backupDcId, clusterId, shardId, peerDcId));
if (!clusterServer.amILeader()) {
logger.info("[getProxyTunnelInfo] not leader");
return null;
}
DcClusterShardPeer dcClusterShardPeer = new DcClusterShardPeer(backupDcId, clusterId, shardId, peerDcId);
ProxyTunnelInfo proxyTunnelInfo = proxyTunnelInfos.get(dcClusterShardPeer);
if (proxyTunnelInfo == null) {
logger.info("[getProxyTunnelInfo][unfound]{}", dcClusterShardPeer);
logger.debug("[getProxyTunnelInfo]{}", proxyTunnelInfos.keySet());
}
return proxyTunnelInfo;
}

@Override
Expand Down

0 comments on commit be6cf44

Please sign in to comment.