[ 
https://issues.apache.org/jira/browse/MESOS-4111?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15103716#comment-15103716
 ] 

haosdent commented on MESOS-4111:
---------------------------------

Could we use
{code}
diff --git a/src/exec/exec.cpp b/src/exec/exec.cpp
index 83dbee9..57fa7fd 100644
--- a/src/exec/exec.cpp
+++ b/src/exec/exec.cpp
@@ -797,7 +797,11 @@ Status MesosExecutorDriver::join()
 Status MesosExecutorDriver::run()
 {
   Status status = start();
-  return status != DRIVER_RUNNING ? status : join();
+  status != DRIVER_RUNNING ? status : join();
+
+  process::finalize();
+
+  return status;
 }
{code}
to avoid use sleep in CommandExecutor?

> Provide a means for libprocess users to exit while ensuring messages are 
> flushed.
> ---------------------------------------------------------------------------------
>
>                 Key: MESOS-4111
>                 URL: https://issues.apache.org/jira/browse/MESOS-4111
>             Project: Mesos
>          Issue Type: Bug
>          Components: libprocess
>            Reporter: Benjamin Mahler
>            Priority: Minor
>
> Currently after a {{send}} there is no way to ensure that the message is 
> flushed on the socket before terminating. We work around this by inserting 
> {{os::sleep}} calls (see MESOS-243, MESOS-4106).
> There are a number of approaches to this:
> (1) Return a Future from send that notifies when the message is flushed from 
> the system.
> (2) Call process::finalize before exiting. This would require that 
> process::finalize flushes all of the outstanding data on any active sockets, 
> which may block.
> Regardless of the approach, there needs to be a timer if we want to guarantee 
> termination.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to