Skip to content

Commit d1865ca

Browse files
committed
address comments
1 parent 25c2185 commit d1865ca

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/agent/rustjail/src/container.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -986,6 +986,12 @@ impl BaseContainer for LinuxContainer {
986986

987987
async fn start(&mut self, mut p: Process) -> Result<()> {
988988
let logger = self.logger.new(o!("eid" => p.exec_id.clone()));
989+
990+
// Check if exec_id is already in use to prevent collisions
991+
if self.processes.contains_key(p.exec_id.as_str()) {
992+
return Err(anyhow!("exec_id '{}' already exists", p.exec_id));
993+
}
994+
989995
let tty = p.tty;
990996
let fifo_file = format!("{}/{}", &self.root, EXEC_FIFO_FILENAME);
991997
info!(logger, "enter container.start!");

src/agent/src/rpc.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,8 +584,7 @@ impl AgentService {
584584
let p = sandbox.find_container_process(cid.as_str(), eid.as_str())?;
585585

586586
p.exit_watchers.push(exit_send);
587-
// pid = p.pid;
588-
587+
589588
p.exit_rx.clone()
590589
};
591590

0 commit comments

Comments
 (0)