mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jie Yu <yujie....@gmail.com>
Subject Re: Review Request 68053: Call any function in a specified namespace.
Date Fri, 27 Jul 2018 23:41:46 GMT

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68053/#review206562
-----------------------------------------------------------



I was chatting with Sergey offline on this. Record the findings here for posterity:

TL;DR: calling `Future::await()` in looper thread might cause the looper thread to be donated
to a libprocess Process. If that Process is very busy (e.g., master or agent Process), it's
possible that the looper thread will never re-gain control.

In this particular case, the namespce setting requests might never be fulfilled if the looper
thread is donated to a busy Process.

This is why this could have happened:
1) `Future::await()` is called
2) Since future is not ready, `latch->await()` will be called.
3) `Latch` will create a new libprocess Process and call `process::wait` on the created Process
(https://github.com/apache/mesos/blob/1.6.0/3rdparty/libprocess/src/process.cpp#L3165)
4) The current thread will be donated to a Process since it has nothing to do (https://github.com/apache/mesos/blob/1.6.0/3rdparty/libprocess/src/process.cpp#L3206)
5) If the Process to be resumed on the looper thread is a super busy thread, meaning that
the message queue is never empty, the looper thread won't get a chance to execute its tasks
on its stack.

- Jie Yu


On July 27, 2018, 8:35 p.m., Sergey Urbanovich wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68053/
> -----------------------------------------------------------
> 
> (Updated July 27, 2018, 8:35 p.m.)
> 
> 
> Review request for mesos, Jie Yu and Qian Zhang.
> 
> 
> Bugs: MESOS-5647
>     https://issues.apache.org/jira/browse/MESOS-5647
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> The NamespaceRunner runs any function in a specified namespace. To do
> that it manages a separate thread which would be re-associated with
> that namespace.
> 
> 
> Diffs
> -----
> 
>   src/linux/ns.hpp 0b4136bd3cc2d3e0cfee163d89469558e699b5f2 
>   src/tests/containerizer/ns_tests.cpp fa4349e29b975550e05b00a1f848a24cd8e4f0de 
> 
> 
> Diff: https://reviews.apache.org/r/68053/diff/3/
> 
> 
> Testing
> -------
> 
> bin/mesos-tests.sh --verbose --gtest_filter="NsTest*" --gtest_break_on_failure --gtest_repeat=100
> 
> 
> Thanks,
> 
> Sergey Urbanovich
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message