coderfender commented on code in PR #7420:
URL: https://github.com/apache/datafusion-comet/pull/7420#discussion_r4478168361


##########
native/native-executors/tests/cluster.rs:
##########
@@ -166,6 +170,24 @@ fn free_port() -> u16 {
         .port()
 }
 
+/// The HTTP status of a GET of `path` on a local port.
+fn http_status(port: u16, path: &str) -> u16 {
+    let mut stream = TcpStream::connect(("127.0.0.1", port)).unwrap();

Review Comment:
   Nit: without a read timeout, `read_to_end` blocks if the server ever keeps 
the connection open, so the test would hang instead of failing. 
`stream.set_read_timeout(Some(Duration::from_secs(10)))` would avoid that.



##########
native/native-executors/src/bin/comet-scheduler.rs:
##########
@@ -79,3 +120,12 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
     }
     Ok(())
 }
+
+/// Creates `dir` if it doesn't exist, and checks that the scheduler can 
create files in it: a
+/// directory that already exists, such as a volume mounted with another 
owner, may not allow it.
+fn check_writable(dir: &Path) -> std::io::Result<()> {
+    std::fs::create_dir_all(dir)?;
+    let probe = dir.join(format!(".comet-scheduler-{}", std::process::id()));

Review Comment:
   In a container the scheduler is usually PID 1, so two schedulers sharing a 
log volume (an HA pair, or an overlapping restart) use the same probe name. If 
A creates it, B creates it again and A removes it, B's `remove_file` fails with 
`NotFound` and B refuses to start. Could the name be unique (e.g. a random 
suffix), or `NotFound` on removal be ignored?



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