mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-28 12:31:04 +00:00
Merge pull request #138 from lifupan/master
grpc: fix the issue of crash agent when didn't find the process
This commit is contained in:
commit
7965445adf
@ -926,7 +926,19 @@ impl protocols::agent_grpc::AgentService for agentService {
|
||||
let eid = req.exec_id.clone();
|
||||
let s = Arc::clone(&self.sandbox);
|
||||
let mut sandbox = s.lock().unwrap();
|
||||
let p = find_process(&mut sandbox, cid.as_str(), eid.as_str(), false).unwrap();
|
||||
let p = match find_process(&mut sandbox, cid.as_str(), eid.as_str(), false) {
|
||||
Ok(v) => v,
|
||||
Err(e) => {
|
||||
let f = sink
|
||||
.fail(RpcStatus::new(
|
||||
RpcStatusCode::InvalidArgument,
|
||||
Some(format!("invalid argument: {}", e)),
|
||||
))
|
||||
.map_err(|_e| error!(sl!(), "invalid argument"));
|
||||
ctx.spawn(f);
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
if p.term_master.is_none() {
|
||||
let f = sink
|
||||
|
Loading…
Reference in New Issue
Block a user