[ https://issues.apache.org/jira/browse/MESOS-7641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16041910#comment-16041910 ]
Yan Xu commented on MESOS-7641: ------------------------------- [~bmahler] We can probably fix it by [dispatching|https://github.com/apache/mesos/blob/b882f66394be1047d6f8ed3136a05eb5fe1e3e8e/3rdparty/libprocess/include/process/delay.hpp#L69] a wrapper (member?) method in {{delay}} that when executed, synchronously call the {{T::*method}} argument. In doing so the wrapper can check if a {{Future}} argument (discarded by {{Timer::cancel}}) is discarded before executed the {{method}}. > process::delay'd method may not be canceled by canceling the returned timer > ---------------------------------------------------------------------------- > > Key: MESOS-7641 > URL: https://issues.apache.org/jira/browse/MESOS-7641 > Project: Mesos > Issue Type: Bug > Reporter: Yan Xu > > It's a common pattern to use {{delay}} to dispatch work into a process at a > later time: e.g., > [Slave::doReliableRegistration|https://github.com/apache/mesos/blob/b882f66394be1047d6f8ed3136a05eb5fe1e3e8e/src/slave/slave.cpp#L972]. > {{delay}} returns a {{Timer}} and a {{Timer}} can be cancelled so its > {{thunk}} won't be executed if it's still pending. However in the case of > {{delay}}, the {{thunk}} is a > [dispatch|https://github.com/apache/mesos/blob/b882f66394be1047d6f8ed3136a05eb5fe1e3e8e/3rdparty/libprocess/include/process/delay.hpp#L69] > that could be already dispatched into the process {{pid}} and cancelling the > timer wouldn't prevent this event from being executed. -- This message was sent by Atlassian JIRA (v6.3.15#6346)