bigdata-memory commented on a change in pull request #601: URL: https://github.com/apache/incubator-teaclave/pull/601#discussion_r791019510
########## File path: services/management/enclave/src/service.rs ########## @@ -662,17 +662,24 @@ impl TeaclaveManagement for TeaclaveManagementService { self.enqueue_to_db(CANCEL_QUEUE_KEY.as_bytes(), &ts)?; } _ => { + // early cancelation // race will not affect correctness/privacy - let task: Task<Cancel> = ts.try_into().map_err(|e| { + let mut task: Task<Cancel> = ts.try_into().map_err(|e| { log::warn!("Cancel state error: {:?}", e); TeaclaveManagementServiceError::PermissionDenied })?; log::debug!("Canceled Task: {:?}", task); + task.update_result(TaskResult::Err(TaskFailure { + reason: "Task canceled".to_string(), + })) + .map_err(|_| TeaclaveManagementServiceError::PermissionDenied)?; let ts: TaskState = task.into(); self.write_to_db(&ts) .map_err(|_| TeaclaveManagementServiceError::StorageError)?; + + log::warn!("Canceled Task writtenback"); Review comment: For the consistency, please adding `:` thanks. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@teaclave.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@teaclave.apache.org For additional commands, e-mail: notifications-h...@teaclave.apache.org