diff --git a/src/agent/rustjail/src/process.rs b/src/agent/rustjail/src/process.rs index cdecae1308..0e7fe73efd 100644 --- a/src/agent/rustjail/src/process.rs +++ b/src/agent/rustjail/src/process.rs @@ -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) { diff --git a/src/agent/src/rpc.rs b/src/agent/src/rpc.rs index 8299ed34b6..988cce5b76 100644 --- a/src/agent/src/rpc.rs +++ b/src/agent/src/rpc.rs @@ -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() { diff --git a/src/runtime-rs/crates/hypervisor/src/dragonball/inner.rs b/src/runtime-rs/crates/hypervisor/src/dragonball/inner.rs index c7c9cb082a..91f9406b88 100644 --- a/src/runtime-rs/crates/hypervisor/src/dragonball/inner.rs +++ b/src/runtime-rs/crates/hypervisor/src/dragonball/inner.rs @@ -341,7 +341,10 @@ impl DragonballInner { // cannot exceed maximum value if new_vcpus > self.config.cpu_info.default_maxvcpus { - return Err(anyhow!("resize vcpu error: cannot greater than maxvcpus")); + warn!( + sl!(), + "Cannot allocate more vcpus than the max allowed number of vcpus. The maximum allowed amount of vcpus will be used instead."); + return Ok((current_vcpus, self.config.cpu_info.default_maxvcpus)); } Ok((current_vcpus, new_vcpus)) diff --git a/tests/integration/kubernetes/k8s-oom.bats b/tests/integration/kubernetes/k8s-oom.bats index f89b761f80..5f45ad78a7 100644 --- a/tests/integration/kubernetes/k8s-oom.bats +++ b/tests/integration/kubernetes/k8s-oom.bats @@ -9,11 +9,15 @@ load "${BATS_TEST_DIRNAME}/../../common.bash" load "${BATS_TEST_DIRNAME}/tests_common.sh" setup() { + [ "${KATA_HYPERVISOR}" == "dragonball" ] && skip "Test is currently failing, see: https://github.com/kata-containers/kata-containers/issues/7271" + pod_name="pod-oom" get_pod_config_dir } @test "Test OOM events for pods" { + [ "${KATA_HYPERVISOR}" == "dragonball" ] && skip "Test is currently failing, see: https://github.com/kata-containers/kata-containers/issues/7271" + # Create pod kubectl create -f "${pod_config_dir}/$pod_name.yaml" @@ -29,6 +33,8 @@ setup() { } teardown() { + [ "${KATA_HYPERVISOR}" == "dragonball" ] && skip "Test is currently failing, see: https://github.com/kata-containers/kata-containers/issues/7271" + # Debugging information kubectl describe "pod/$pod_name" kubectl get "pod/$pod_name" -o yaml