andygrove commented on code in PR #2775:
URL: 
https://github.com/apache/datafusion-ballista/pull/2775#discussion_r4643009009


##########
ballista/executor/src/executor_process.rs:
##########
@@ -507,6 +507,48 @@ pub async fn start_executor_process_with_memory_metrics(
     start_executor_process_inner(opt, Some(memory_metrics)).await
 }
 
+fn create_default_work_dir() -> ballista_core::error::Result<(String, 
TempDir)> {
+    let temp_dir = TempDir::new()?;
+
+    #[cfg(unix)]
+    {
+        use std::os::unix::fs::PermissionsExt;
+        std::fs::set_permissions(
+            temp_dir.path(),
+            std::fs::Permissions::from_mode(0o700),
+        )?;
+    }
+
+    let path = temp_dir
+        .path()
+        .to_str()
+        .map(ToOwned::to_owned)
+        .ok_or_else(|| BallistaError::Configuration("Unable to bind work 
dir".into()))?;
+
+    Ok((path, temp_dir))
+}
+
+#[cfg(all(test, unix))]
+mod default_work_dir_regression_tests {

Review Comment:
   Small thing. Could the new test live in the existing `mod tests` at the 
bottom of the file, behind `#[cfg(unix)]`? That keeps the production code in 
one piece.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to