mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vinod Kone <vinodk...@gmail.com>
Subject Re: Review Request 59641: Follow symlinks when resolving paths specified in the various master/agent endpoints.
Date Thu, 01 Jun 2017 19:33:17 GMT

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




src/slave/slave.cpp
Lines 5311 (patched)
<https://reviews.apache.org/r/59641/#comment250027>

    no need for this. see below.



src/slave/slave.cpp
Lines 5322 (patched)
<https://reviews.apache.org/r/59641/#comment250026>

    tl:dr; Don't do `garbageCollect` and move the `.then` from #5323 to #5332
    
    I don't think we should gc the symlink here. If another instance of the executor lands
on this node the symlink will be pointing to that instance's sandbox; so scheduling it for
gc is dangerous!
    
    The symlink gets automatically gc'ed when the top level executor directory gets gc'ed;
see #5332 below. So we don't need to call `garbageCollect` on the symlink specifically. But,
we still need to make sure we remove the entry from `files` when the top level executor directory
gets removed.



src/slave/slave.cpp
Lines 6963 (patched)
<https://reviews.apache.org/r/59641/#comment250024>

    see below.



src/slave/slave.cpp
Lines 7176-7177 (patched)
<https://reviews.apache.org/r/59641/#comment250022>

    s/"runs/latest"/"latest"/



src/slave/slave.cpp
Lines 7177 (patched)
<https://reviews.apache.org/r/59641/#comment250023>

    s/task/task without having to know the container id/



src/slave/slave.cpp
Lines 7215-7216 (patched)
<https://reviews.apache.org/r/59641/#comment250028>

    no need for this? see above.



src/slave/slave.cpp
Lines 7215-7216 (patched)
<https://reviews.apache.org/r/59641/#comment250047>

    See above.
    
    Move `.then` to #7223.



src/tests/files_tests.cpp
Lines 252-287 (original), 253-294 (patched)
<https://reviews.apache.org/r/59641/#comment250021>

    Not sure if this test adds much value?
    
    The fact that you created a symlink called "latest" has no bearing with doing an attach
with a virtual name called "latest".
    
    I think it's worth writing a test that specifically checks that "..../runs/latest" can
be used to browse the executor's sandbox. You can modify one of the existing tests (perhaps
ExitedExecutor test in gc_tests.cpp) that brings up an executor.


- Vinod Kone


On May 31, 2017, 6:57 p.m., Aaron Wood wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59641/
> -----------------------------------------------------------
> 
> (Updated May 31, 2017, 6:57 p.m.)
> 
> 
> Review request for mesos, Andrew Schwartzmeyer, James Peach, Vinod Kone, and Zhitao Li.
> 
> 
> Bugs: MESOS-7572
>     https://issues.apache.org/jira/browse/MESOS-7572
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> The main benefit of following symlinks in endpoints such as `/files` is that frameworks
will be able to construct a path to the sandbox much easier. This will assist framework developers
in making features that need to provide a path when hitting various operator API endpoints.
Currently, making use of a path ending in `runs/latest` throws a 404.
> 
> One such application could be a scheduler providing the ability for users to work with
their task's sandbox directly without going to the Mesos UI, API endpoints, or the actual
system themselves.
> 
> 
> Diffs
> -----
> 
>   src/slave/slave.cpp 14de72fa4 
>   src/tests/files_tests.cpp c703cae03 
> 
> 
> Diff: https://reviews.apache.org/r/59641/diff/3/
> 
> 
> Testing
> -------
> 
> `mkdir build && cd build && cmake .. && make -j2 && make
check -j2`
> 
> Checked the original behavior: 
> ```
> curl -i localhost:5051/files/browse?path=/tmp/slave/slaves/d3566e51-4d13-4ed1-b66b-d538d3d7ef28-S0/frameworks/d3566e51-4d13-4ed1-b66b-d538d3d7ef28-0001/executors/testapp-924b5c1524d84676a6a71665e2054d31/runs/cbec99c9-da2d-4aaa-bab7-4cee9a4df031
> HTTP/1.1 200 OK
> Date: Tue, 30 May 2017 17:43:08 GMT
> Content-Length: 644
> Content-Type: application/json
> 
> [{"gid":"root","mode":"-rw-r--r--","mtime":1496161813.0,"nlink":1,"path":"\/tmp\/slave\/slaves\/d3566e51-4d13-4ed1-b66b-d538d3d7ef28-S0\/frameworks\/d3566e51-4d13-4ed1-b66b-d538d3d7ef28-0001\/executors\/testapp-924b5c1524d84676a6a71665e2054d31\/runs\/cbec99c9-da2d-4aaa-bab7-4cee9a4df031\/stderr","size":255,"uid":"root"},{"gid":"root","mode":"-rw-r--r--","mtime":1496161812.0,"nlink":1,"path":"\/tmp\/slave\/slaves\/d3566e51-4d13-4ed1-b66b-d538d3d7ef28-S0\/frameworks\/d3566e51-4d13-4ed1-b66b-d538d3d7ef28-0001\/executors\/testapp-924b5c1524d84676a6a71665e2054d31\/runs\/cbec99c9-da2d-4aaa-bab7-4cee9a4df031\/stdout","size":1142,"uid":"root"}]
> ```
> 
> Checked the new behavior (this would return a 404 before this patch):
> ```
> curl -i localhost:5051/files/browse?path=/tmp/slave/slaves/d3566e51-4d13-4ed1-b66b-d538d3d7ef28-S0/frameworks/d3566e51-4d13-4eors/testapp-924b5c1524d84676a6a71665e2054d31/runs/latest
> HTTP/1.1 200 OK
> Date: Tue, 30 May 2017 17:43:13 GMT
> Content-Length: 584
> Content-Type: application/json
> 
> [{"gid":"root","mode":"-rw-r--r--","mtime":1496161813.0,"nlink":1,"path":"\/tmp\/slave\/slaves\/d3566e51-4d13-4ed1-b66b-d538d3d7ef28-S0\/frameworks\/d3566e51-4d13-4ed1-b66b-d538d3d7ef28-0001\/executors\/testapp-924b5c1524d84676a6a71665e2054d31\/runs\/latest\/stderr","size":255,"uid":"root"},{"gid":"root","mode":"-rw-r--r--","mtime":1496161812.0,"nlink":1,"path":"\/tmp\/slave\/slaves\/d3566e51-4d13-4ed1-b66b-d538d3d7ef28-S0\/frameworks\/d3566e51-4d13-4ed1-b66b-d538d3d7ef28-0001\/executors\/testapp-924b5c1524d84676a6a71665e2054d31\/runs\/latest\/stdout","size":1142,"uid":"root"}]
> ```
> 
> 
> Thanks,
> 
> Aaron Wood
> 
>


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