Skip to content

Commit

Permalink
Revert "agent: fix the issue of exec hang with a backgroud process"
Browse files Browse the repository at this point in the history
This reverts commit 25d2fb0.

The reason we're reverting the commit is because it to check whether
it's the cause for the regression on devmapper tests.

Fixes: kata-containers#7253
Depends-on: github.com/kata-containers/tests#5705

Signed-off-by: Fabiano Fidêncio <[email protected]>
  • Loading branch information
fidencio authored and mayamrinal committed Dec 6, 2023
1 parent eafda10 commit 99d9b87
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/agent/rustjail/src/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ impl Process {

pub fn notify_term_close(&mut self) {
let notify = self.term_exit_notifier.clone();
notify.notify_waiters();
notify.notify_one();
}

pub fn close_stdin(&mut self) {
Expand Down
5 changes: 2 additions & 3 deletions src/agent/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -595,16 +595,15 @@ impl AgentService {
let cid = req.container_id;
let eid = req.exec_id;

let term_exit_notifier;
let mut term_exit_notifier = Arc::new(tokio::sync::Notify::new());
let reader = {
let s = self.sandbox.clone();
let mut sandbox = s.lock().await;

let p = sandbox.find_container_process(cid.as_str(), eid.as_str())?;

term_exit_notifier = p.term_exit_notifier.clone();

if p.term_master.is_some() {
term_exit_notifier = p.term_exit_notifier.clone();
p.get_reader(StreamType::TermMaster)
} else if stdout {
if p.parent_stdout.is_some() {
Expand Down

0 comments on commit 99d9b87

Please sign in to comment.