[ 
https://issues.apache.org/jira/browse/MESOS-6158?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Benjamin Bannier updated MESOS-6158:
------------------------------------
    Description: 
Our custom clang-tidy checks identified the following use of {{this}} capture 
without {{dispatch}} / {{defer}}.

{code}
src/docker/executor.cpp:396:38: warning: callback capturing this should be 
dispatched/deferred to a specific PID [mesos-this-capture]
      .after(DOCKER_INSPECT_TIMEOUT, [=](const Future<Nothing>&) {
                                     ^
{code}

The issue here is that the stored callback modifies the member variable 
{{inspect}}, but is not tied to the instance's lifetime. In general such access 
can lead to data races, or in more extreme cases cause the callback to work on 
already cleaned up memory.

  was:
Our custom clang-tidy checks identified the following use of {{this}} capture 
without {{dispatch}} / {{defer}}.

{code}
src/docker/executor.cpp:396:38: warning: callback capturing this should be 
dispatched/deferred to a specific PID [mesos-this-capture]
      .after(DOCKER_INSPECT_TIMEOUT, [=](const Future<Nothing>&) {
                                     ^
{code}


> Docker executor uses callback capturing this which isn't dispatched/deferred
> ----------------------------------------------------------------------------
>
>                 Key: MESOS-6158
>                 URL: https://issues.apache.org/jira/browse/MESOS-6158
>             Project: Mesos
>          Issue Type: Bug
>          Components: docker
>    Affects Versions: 1.0.0
>            Reporter: Benjamin Bannier
>              Labels: clang-tidy
>
> Our custom clang-tidy checks identified the following use of {{this}} capture 
> without {{dispatch}} / {{defer}}.
> {code}
> src/docker/executor.cpp:396:38: warning: callback capturing this should be 
> dispatched/deferred to a specific PID [mesos-this-capture]
>       .after(DOCKER_INSPECT_TIMEOUT, [=](const Future<Nothing>&) {
>                                      ^
> {code}
> The issue here is that the stored callback modifies the member variable 
> {{inspect}}, but is not tied to the instance's lifetime. In general such 
> access can lead to data races, or in more extreme cases cause the callback to 
> work on already cleaned up memory.



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

Reply via email to