> On May 31, 2017, 1:05 a.m., Vinod Kone wrote: > > src/files/files.cpp > > Line 874 (original), 874 (patched) > > <https://reviews.apache.org/r/59641/diff/2/?file=1734876#file1734876line874> > > > > I don't follow this. Why are we checking random prefixes for whether > > they are symlinks on the file system?
I had done this because the path parts that are stored in the map represent the resolved symlink. The path that's passed into this method here is the symlink pre-resolved. Without that check the `continue` statement gets hit until we're out of the loop and then return `None()`. > On May 31, 2017, 1:05 a.m., Vinod Kone wrote: > > src/files/files.cpp > > Lines 892-909 (patched) > > <https://reviews.apache.org/r/59641/diff/2/?file=1734876#file1734876line892> > > > > Instead of doing all this, can we just "attach" "...../run/latest" to > > the files actor when we attach the ".../run/<run-id>"? See > > `Framework::addExecutor` and `Framework::recoverExecutor` in slave.cpp. > > Look for `files->attach(...)`. That to me seems more straightforward? Sounds good, I'll have a look. > On May 31, 2017, 1:05 a.m., Vinod Kone wrote: > > src/files/files.cpp > > Line 893 (original), 912 (patched) > > <https://reviews.apache.org/r/59641/diff/2/?file=1734876#file1734876line912> > > > > I would do the shadow variable fix in a separate dependent review > > instead of mixing it here. I'll revert my naming changes here. Why is it that this kind of change needs a separate patch? - Aaron ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/59641/#review176415 ----------------------------------------------------------- On May 30, 2017, 8:14 p.m., Aaron Wood wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/59641/ > ----------------------------------------------------------- > > (Updated May 30, 2017, 8:14 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/files/files.cpp b03279ee0 > src/tests/files_tests.cpp c703cae03 > > > Diff: https://reviews.apache.org/r/59641/diff/2/ > > > 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 > >
