> On Feb. 2, 2018, 1:43 p.m., Andrew Schwartzmeyer wrote: > > src/checks/checker_process.cpp > > Lines 535-537 (original), 543-547 (patched) > > <https://reviews.apache.org/r/65419/diff/1/?file=1950448#file1950448line544> > > > > Can you explain why this was changed a little more? Maybe an example > > would help. > > Akash Gupta wrote: > Originally, it was setting the `docker exec` in `shell` mode, which > wrapped it with `sh -c ''`. So, the command was `sh -c 'docker exec sh -c " > <cmd> "'`, which was breaking on Windows due to quoting. Now, it skips the > `sh` wrapper and calls `docker exec sh -c '<cmd>'` (in exec form, so it's > actually `["docker", "exec", "sh", "-c", cmd]`) directly. > > This fixes a couple of things: > - The tests will actually pass on Windows now. Before, due to the crazy > quoting, the tests were failing. > - On Linux, your command can now actually have `"` in it instead of > having to escape it. For example, `echo "Hello World!"` was originally > getting changed to `sh -c 'docker exec sh -c " echo "Hello World!" "'`, which > is broken. > - On Linux, the mesos-agent shell doesn't accidently interpret the > command anymore. For example, if your command was `ls $HOME`, originally, it > was running `sh -c 'docker exec sh -c " ls $HOME "'`, which meant that > `$HOME` was being evaluated in the context of the mesos-agent due to > the first `sh -c` instead of the docker container. > > I've seen a couple of issues caused due to the weird quoting. ( > https://issues.apache.org/jira/browse/MESOS-4812 and > https://github.com/mesosphere/marathon/issues/5136)
Hm, take a look at this: https://reviews.apache.org/r/54846/ - Andrew ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/65419/#review196734 ----------------------------------------------------------- On Feb. 8, 2018, 9:50 a.m., Akash Gupta wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/65419/ > ----------------------------------------------------------- > > (Updated Feb. 8, 2018, 9:50 a.m.) > > > Review request for mesos, Alexander Rukletsov, Andrew Schwartzmeyer, Gaston > Kleiman, and Joseph Wu. > > > Bugs: MESOS-8498 > https://issues.apache.org/jira/browse/MESOS-8498 > > > Repository: mesos > > > Description > ------- > > The docker executor was wrapping the docker exec command around with > `sh -c ""`, which was causing quoting issues, especially on Windows. > Now, the comamnd health check simply runs `docker exec` without any > wrapping. > > > Diffs > ----- > > src/checks/checker_process.cpp ddb197b8cc2c503fef5ae20af32f5881fff9833f > > > Diff: https://reviews.apache.org/r/65419/diff/2/ > > > Testing > ------- > > make check > > > Thanks, > > Akash Gupta > >
