[
https://issues.apache.org/jira/browse/MESOS-4111?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15107194#comment-15107194
]
Joseph Wu commented on MESOS-4111:
----------------------------------
{{process::finalize}} only waits for the event queue on all processes to
finish. (It does this by putting a {{TerminateEvent}} at the back of the
queue.)
Writes to a socket (or any FD), do not have events. So you'd need to augment
{{process::finalize}} to clean up and flush sockets too. This
[patch|https://reviews.apache.org/r/40266] is part of a chain to do something
similar.
> 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)