mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-10-22 20:39:41 +00:00
agent,runtime-rs: fix container io detach and attach
Partially fix some issues related to container io detach and attach. Fixes: #6714 Signed-off-by: Zixuan Tan <tanzixuan.me@gmail.com>
This commit is contained in:
@@ -337,15 +337,12 @@ impl Process {
|
||||
|
||||
/// Close the stdin of the process in container.
|
||||
pub async fn close_io(&mut self, agent: Arc<dyn Agent>) {
|
||||
if self.passfd_io.is_some() {
|
||||
// In passfd io mode, if containerd closes stdin stream, the
|
||||
// agent can get the close event from the vsock connection.
|
||||
// so we just return here.
|
||||
return;
|
||||
// In passfd io mode, the stdin close and sync logic is handled
|
||||
// in the agent side.
|
||||
if self.passfd_io.is_none() {
|
||||
self.wg_stdin.wait().await;
|
||||
}
|
||||
|
||||
self.wg_stdin.wait().await;
|
||||
|
||||
let req = agent::CloseStdinRequest {
|
||||
process_id: self.process.clone().into(),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user