andygrove opened a new issue, #2936:
URL: https://github.com/apache/datafusion-ballista/issues/2936

   **Describe the bug**
   
   The in-process standalone executor has the same problem as #2767, which was 
fixed for the executor binary in #2775.
   
   In `ballista/executor/src/standalone.rs`, 
`new_standalone_executor_from_builder` creates its work directory like this:
   
   ```rust
   let work_dir = TempDir::new()?.path().to_str().unwrap().to_string();
   ```
   
   The `TempDir` guard is a temporary, so it is dropped at the end of that 
statement and the directory is deleted straight away. The executor and 
`BallistaFlightService` are then handed a path that no longer exists. Shuffle 
writes later recreate it with process-default permissions instead of 
`TempDir`'s private `0700`, and nothing removes it when the standalone cluster 
goes away, so files pile up in the system temp directory.
   
   **To Reproduce**
   
   1. Create a `SessionContext::standalone()` session.
   2. Note the `work_dir: ...` line logged at startup and check that the path 
does not exist right after startup.
   3. Run a query that shuffles. The directory shows up again with default 
permissions and stays after the process exits.
   
   **Expected behavior**
   
   The directory exists with `0700` permissions for as long as the standalone 
executor runs, and is removed when it shuts down.
   
   **Additional context**
   
   This one is a bit different from the binary fix. 
`new_standalone_executor_from_builder` returns after spawning the Flight server 
and the poll loop (or the push-mode gRPC server), so holding the guard in a 
local is not enough. One option is to move the guard into the spawned task that 
already keeps the push-mode `ShutdownNotifier` alive, and do the same for the 
Flight server task in pull mode. `create_default_work_dir` from #2775 could be 
reused for the permissions.
   
   `unwrap()` on the `to_str()` call can also panic on a non-UTF-8 temp path. 
It would be good to return a `BallistaError::Configuration` like the binary 
does.
   


-- 
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