Skip to content

Commit 91fd453

Browse files
committed
fix(gateway): read handshakes off the routing lock in Admin.GetInfo/GetMeta
1 parent 136f6d8 commit 91fd453

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎dstack/gateway/src/admin_service.rs‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ impl AdminRpc for AdminRpcHandler {
144144
.kv_store()
145145
.get_best_zt_domain()
146146
.unwrap_or_default();
147+
let handshakes = self.state.latest_handshakes(None)?;
147148
let state = self.state.lock();
148-
let handshakes = state.latest_handshakes(None)?;
149149

150150
if let Some(instance) = state.state.instances.get(&request.id) {
151151
let host_info = HostInfo {
@@ -177,11 +177,10 @@ impl AdminRpc for AdminRpcHandler {
177177
}
178178

179179
async fn get_meta(self) -> Result<GetMetaResponse> {
180-
let state = self.state.lock();
181-
let handshakes = state.latest_handshakes(None)?;
180+
let handshakes = self.state.latest_handshakes(None)?;
182181

183182
// Total registered instances
184-
let registered = state.state.instances.len();
183+
let registered = self.state.lock().state.instances.len();
185184

186185
// Get current timestamp
187186
let now = SystemTime::now()

0 commit comments

Comments
 (0)