samuel7james commented on code in PR #2607:
URL: 
https://github.com/apache/datafusion-ballista/pull/2607#discussion_r4356662880


##########
ballista/executor/src/executor_process.rs:
##########
@@ -652,11 +652,9 @@ async fn start_executor_process_inner(
         // this feature was added to support docker-compose so that we can 
have the executor
         // wait for the scheduler to start, or at least run for 10 seconds 
before failing so
         // that docker-compose's restart policy will restart the container.
-        let start_time = Instant::now().elapsed().as_secs();
+        let start_time = Instant::now();
         let mut x = None;
-        while x.is_none()
-            && Instant::now().elapsed().as_secs() - start_time < 
connect_timeout
-        {
+        while x.is_none() && start_time.elapsed() < 
Duration::from_secs(connect_timeout) {

Review Comment:
   Done, the deadline is computed once now and the loop checks `Instant::now() 
< deadline`. The test still passes in about 1s.
   
   Good point about `connect()` running past the deadline when the scheduler 
drops packets. I'll leave it out of this PR and can send `timeout_at` as a 
follow-up.
   



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