mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-10 20:32:54 +00:00
Merge pull request #10058 from Apokleos/enhance-vsock-connect
runtime-rs: enhance debug info for agent connect.
This commit is contained in:
commit
4e003a2125
@ -113,7 +113,13 @@ impl KataAgent {
|
|||||||
sock::new(&inner.socket_address, inner.config.server_port).context("new sock")?;
|
sock::new(&inner.socket_address, inner.config.server_port).context("new sock")?;
|
||||||
let stream = sock.connect(&config).await.context("connect")?;
|
let stream = sock.connect(&config).await.context("connect")?;
|
||||||
let fd = stream.into_raw_fd();
|
let fd = stream.into_raw_fd();
|
||||||
info!(sl!(), "get stream raw fd {:?}", fd);
|
info!(
|
||||||
|
sl!(),
|
||||||
|
"get stream raw fd {:?} with socket address: {:?} and server_port {:?}",
|
||||||
|
fd,
|
||||||
|
&inner.socket_address,
|
||||||
|
inner.config.server_port
|
||||||
|
);
|
||||||
let c = Client::new(fd);
|
let c = Client::new(fd);
|
||||||
inner.client = Some(c);
|
inner.client = Some(c);
|
||||||
inner.client_fd = fd;
|
inner.client_fd = fd;
|
||||||
|
@ -69,11 +69,15 @@ impl Sock for Vsock {
|
|||||||
);
|
);
|
||||||
return Ok(Stream::Vsock(stream));
|
return Ok(Stream::Vsock(stream));
|
||||||
}
|
}
|
||||||
Err(_) => {
|
Err(e) => {
|
||||||
|
debug!(sl!(), "retry after {} ms: failed to connect to agent via vsock at {} attempts: {:?}", config.dial_timeout_ms, i, e);
|
||||||
tokio::time::sleep(Duration::from_millis(config.dial_timeout_ms)).await;
|
tokio::time::sleep(Duration::from_millis(config.dial_timeout_ms)).await;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Err(anyhow!("cannot connect to agent ttrpc server {:?}", config))
|
Err(anyhow!(
|
||||||
|
"cannot connect vsock to agent ttrpc server {:?}",
|
||||||
|
config
|
||||||
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -382,7 +382,10 @@ impl Sandbox for VirtSandbox {
|
|||||||
.get_agent_socket()
|
.get_agent_socket()
|
||||||
.await
|
.await
|
||||||
.context("get agent socket")?;
|
.context("get agent socket")?;
|
||||||
self.agent.start(&address).await.context("connect")?;
|
self.agent
|
||||||
|
.start(&address)
|
||||||
|
.await
|
||||||
|
.context(format!("connect to address {:?}", &address))?;
|
||||||
|
|
||||||
self.resource_manager
|
self.resource_manager
|
||||||
.setup_after_start_vm()
|
.setup_after_start_vm()
|
||||||
|
Loading…
Reference in New Issue
Block a user