NoahKusaba commented on PR #2973:
URL: 
https://github.com/apache/datafusion-ballista/pull/2973#issuecomment-7210090603

   Thanks for working on this. The core fix looks right to me, but the PR 
covers a lot more than #2936 asks for: about 150 lines of production code 
alongside ~1000 lines of tests and a new test-only feature in `ballista-core`. 
Would you be open to splitting it up? That would make it much easier to review 
and land the actual fix quickly.
   
   I see roughly five separate changes here:
   
   1. **The fix for #2936.** Standalone uses `create_default_work_dir()` for 
the 0700 permissions and the non-UTF-8 error, and `Executor` / 
`BallistaFlightService` hold the `Arc<TempDir>`. The `work_dir_path` refactor 
and its non-UTF-8 tests fit here too. For tests, 
`standalone_{pull,push}_work_dir_lifetime` and 
`caller_owned_work_dir_is_not_removed` seem like enough. (The issue also 
suggests an option that only touches `standalone.rs`: move the guard into the 
spawned tasks that already live as long as the executor. Either approach is 
fine with me.)
   2. **Push-mode Flight server lifecycle.** The Flight server is now started 
after registration and stopped by the `ShutdownNotifier`. That fixes a real 
leak when registration fails, but it is a behavior change of its own, so I'd 
like it in a separate PR with the registration failure/cancellation tests and 
the `MockScheduler` changes.
   3. **Flight response streams holding the owner** (`retain_work_dir` and the 
`spawn_blocking` readers). This only matters when a response outlives both the 
executor and the Flight service. That's reasonable to handle, but it can be a 
follow-up.
   4. **`DedicatedExecutor` holding the owner** so the runtime drains before 
cleanup.
   5. **The `test-disk-writer-gate` feature in `ballista-core`.**
   
   I'm hesitant about 4 and 5. The race they cover only happens while an 
in-process standalone cluster is shutting down. Fixing it adds test-only hooks 
to `write_stream_to_disk` and a global mutex registry that is checked on every 
write whenever the feature is enabled. Because executor enables it through a 
dev-dependency, that includes workspace test builds as well as `--all-features` 
builds. I'd rather leave this out unless there is a concrete failure that needs 
it.
   
   Items 2–4 each depend on 1 but not on each other.
   
   A few smaller things for whichever PRs come out of this:
   
   - The `AX2936_*` assertion messages look like internal labels. Plain 
messages, or none, would be better.
   - `MockScheduler::heart_beat_from_executor` changed from `not_called()` to 
returning `Ok`. That loosens the existing `poll_loop` test. Could the new 
behavior be opt-in, like `registration` is?
   - In `execution_loop.rs`, the job-data cleanup now clones the whole executor 
just to keep the owner alive. If the owner needs to be held there, cloning 
`work_dir_owner()` alongside `work_dir` would make the intent clearer.
   
   ---
   *This review was drafted with AI assistance (Claude) and reviewed by me 
before posting.*
   


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