Skip to content

Commit

Permalink
Revert "Remote discovery: fix bug where remote discovery never resync…
Browse files Browse the repository at this point in the history
…s remote CGWs"
  • Loading branch information
Cahb authored Sep 27, 2024
1 parent 757b88b commit a26ba6c
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/cgw_remote_discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -996,26 +996,25 @@ impl CGWRemoteDiscovery {
// try to use internal cache first
if let Some(cl) = self.remote_cgws_map.read().await.get(&shard_id) {
if let Err(_e) = cl.client.relay_request_stream(stream).await {
warn!(
"Failed to relay message. CGW{} seems to be unreachable at [{}:{}], will try to resync map and try again",
error!(
"Failed to relay message. CGW{} seems to be unreachable at [{}:{}]",
shard_id, cl.shard.server_host, cl.shard.server_port
);
} else {
return Ok(());
}

return Ok(());
}

// then try to use redis
let _ = self.sync_remote_cgw_map().await;
if let Some(cl) = self.remote_cgws_map.read().await.get(&shard_id) {
if let Err(_e) = cl.client.relay_request_stream(stream).await {
error!(
"Failed to relay message event after resync. CGW{} seems to be unreachable at [{}:{}]",
"Failed to relay message. CGW{} seems to be unreachable at [{}:{}]",
shard_id, cl.shard.server_host, cl.shard.server_port
);
} else {
return Ok(());
}
return Ok(());
}

error!("No suitable CGW instance #{shard_id} was discovered, cannot relay msg");
Expand Down

0 comments on commit a26ba6c

Please sign in to comment.