You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Aaron Wood via Review Board <no...@reviews.apache.org> on 2017/04/10 18:16:15 UTC

Review Request 58317: Prevent agent from crashing when the ID is longer than the maximum file name length.

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

Review request for mesos, Jie Yu and James Peach.


Bugs: MESOS-7346
    https://issues.apache.org/jira/browse/MESOS-7346


Repository: mesos


Description
-------

When launching a task with a very long name `mkdir` will fail and crash the agent, making it quick and easy to remotely crash any agent(s). This changes makes sure that we never exceed the default file name limit of most of the file systems out there. If the limit is exceed a `TASK_ERROR` is instead sent back to the client.


Diffs
-----

  src/common/validation.cpp 544d3a0bf 


Diff: https://reviews.apache.org/r/58317/diff/1/


Testing
-------

Built Mesos, ran 1 master and 1 agent locally, and launched a task with a name > 255 characters through our own custom framework.

```
I0410 14:04:15.761109 28528 master.cpp:6323] Sending status update TASK_ERROR for task tesijetjijwtjwitjweitjweitjwitjweitjtijeiojwetoijetweoijwilgjwkdgsjskd.nlskdgnldksnglsdkgndslgjdslgjsdlgjldskgjsdlkgjslkgjslkdgjsdlkgjskldgjweiojgoeiwgjweoigjewoitjweoitjewiotjewitjweitjewitjwewejiowejiewtiwethewothweuothewouthuthwouthwuothgwuoghwouhweouthewhtiewtwetwhtohwethwetwehtwehtwjethwejlthwejlthwejhtwejthwejkthwejkthwejkthwejthwkthwekthwtkjwthkwjehtjkwehtkjwehtkjwehtkjwehtkwejhtewjkthewkjthewjkthwekjthwekjthwekjthwekjthwekjhtwekhtewkapplication227741021670-4A491BFF-F50D-4F17-B304-AD23423F15EE of framework 9e8d9439-7ed2-4968-a8cb-f46273c2d9af-0000 'ID must not be greater than 255 characters'
```


Thanks,

Aaron Wood


Re: Review Request 58317: Prevent agent from crashing when the ID is longer than the maximum file name length.

Posted by Mesos Reviewbot <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/58317/#review171490
-----------------------------------------------------------



Patch looks great!

Reviews applied: [58317]

Passed command: export OS='ubuntu:14.04' BUILDTOOL='autotools' COMPILER='gcc' CONFIGURATION='--verbose' ENVIRONMENT='GLOG_v=1 MESOS_VERBOSE=1'; ./support/docker-build.sh

- Mesos Reviewbot


On April 10, 2017, 6:16 p.m., Aaron Wood wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/58317/
> -----------------------------------------------------------
> 
> (Updated April 10, 2017, 6:16 p.m.)
> 
> 
> Review request for mesos, Jie Yu and James Peach.
> 
> 
> Bugs: MESOS-7346
>     https://issues.apache.org/jira/browse/MESOS-7346
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> When launching a task with a very long name `mkdir` will fail and crash the agent, making it quick and easy to remotely crash any agent(s). This changes makes sure that we never exceed the default file name limit of most of the file systems out there. If the limit is exceed a `TASK_ERROR` is instead sent back to the client.
> 
> 
> Diffs
> -----
> 
>   src/common/validation.cpp 544d3a0bf 
> 
> 
> Diff: https://reviews.apache.org/r/58317/diff/1/
> 
> 
> Testing
> -------
> 
> Built Mesos, ran 1 master and 1 agent locally, and launched a task with a name > 255 characters through our own custom framework.
> 
> ```
> I0410 14:04:15.761109 28528 master.cpp:6323] Sending status update TASK_ERROR for task tesijetjijwtjwitjweitjweitjwitjweitjtijeiojwetoijetweoijwilgjwkdgsjskd.nlskdgnldksnglsdkgndslgjdslgjsdlgjldskgjsdlkgjslkgjslkdgjsdlkgjskldgjweiojgoeiwgjweoigjewoitjweoitjewiotjewitjweitjewitjwewejiowejiewtiwethewothweuothewouthuthwouthwuothgwuoghwouhweouthewhtiewtwetwhtohwethwetwehtwehtwjethwejlthwejlthwejhtwejthwejkthwejkthwejkthwejthwkthwekthwtkjwthkwjehtjkwehtkjwehtkjwehtkjwehtkwejhtewjkthewkjthewjkthwekjthwekjthwekjthwekjthwekjhtwekhtewkapplication227741021670-4A491BFF-F50D-4F17-B304-AD23423F15EE of framework 9e8d9439-7ed2-4968-a8cb-f46273c2d9af-0000 'ID must not be greater than 255 characters'
> ```
> 
> 
> Thanks,
> 
> Aaron Wood
> 
>


Re: Review Request 58317: Prevent agent from crashing when the ID is longer than the maximum file name length.

Posted by James Peach <jp...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/58317/#review171488
-----------------------------------------------------------


Ship it!




Ship It!

- James Peach


On April 10, 2017, 6:16 p.m., Aaron Wood wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/58317/
> -----------------------------------------------------------
> 
> (Updated April 10, 2017, 6:16 p.m.)
> 
> 
> Review request for mesos, Jie Yu and James Peach.
> 
> 
> Bugs: MESOS-7346
>     https://issues.apache.org/jira/browse/MESOS-7346
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> When launching a task with a very long name `mkdir` will fail and crash the agent, making it quick and easy to remotely crash any agent(s). This changes makes sure that we never exceed the default file name limit of most of the file systems out there. If the limit is exceed a `TASK_ERROR` is instead sent back to the client.
> 
> 
> Diffs
> -----
> 
>   src/common/validation.cpp 544d3a0bf 
> 
> 
> Diff: https://reviews.apache.org/r/58317/diff/1/
> 
> 
> Testing
> -------
> 
> Built Mesos, ran 1 master and 1 agent locally, and launched a task with a name > 255 characters through our own custom framework.
> 
> ```
> I0410 14:04:15.761109 28528 master.cpp:6323] Sending status update TASK_ERROR for task tesijetjijwtjwitjweitjweitjwitjweitjtijeiojwetoijetweoijwilgjwkdgsjskd.nlskdgnldksnglsdkgndslgjdslgjsdlgjldskgjsdlkgjslkgjslkdgjsdlkgjskldgjweiojgoeiwgjweoigjewoitjweoitjewiotjewitjweitjewitjwewejiowejiewtiwethewothweuothewouthuthwouthwuothgwuoghwouhweouthewhtiewtwetwhtohwethwetwehtwehtwjethwejlthwejlthwejhtwejthwejkthwejkthwejkthwejthwkthwekthwtkjwthkwjehtjkwehtkjwehtkjwehtkjwehtkwejhtewjkthewkjthewjkthwekjthwekjthwekjthwekjthwekjhtwekhtewkapplication227741021670-4A491BFF-F50D-4F17-B304-AD23423F15EE of framework 9e8d9439-7ed2-4968-a8cb-f46273c2d9af-0000 'ID must not be greater than 255 characters'
> ```
> 
> 
> Thanks,
> 
> Aaron Wood
> 
>


Re: Review Request 58317: Prevent agent from crashing when the ID is longer than the maximum file name length.

Posted by Aaron Wood via Review Board <no...@reviews.apache.org>.

> On April 10, 2017, 11:48 p.m., Jie Yu wrote:
> > src/common/validation.cpp
> > Lines 42 (patched)
> > <https://reviews.apache.org/r/58317/diff/2/?file=1687727#file1687727line42>
> >
> >     255? Cau you use NAME_MAX in the error message as well?

My fault, I should have done that initially when I switched to using `NAME_MAX`.


- Aaron


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


On April 10, 2017, 10:37 p.m., Aaron Wood wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/58317/
> -----------------------------------------------------------
> 
> (Updated April 10, 2017, 10:37 p.m.)
> 
> 
> Review request for mesos, Jie Yu and James Peach.
> 
> 
> Bugs: MESOS-7346
>     https://issues.apache.org/jira/browse/MESOS-7346
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> When launching a task with a very long name `mkdir` will fail and crash the agent, making it quick and easy to remotely crash any agent(s). This changes makes sure that we never exceed the default file name limit of most of the file systems out there. If the limit is exceed a `TASK_ERROR` is instead sent back to the client.
> 
> 
> Diffs
> -----
> 
>   src/common/validation.cpp 544d3a0bf 
> 
> 
> Diff: https://reviews.apache.org/r/58317/diff/2/
> 
> 
> Testing
> -------
> 
> Built Mesos, ran 1 master and 1 agent locally, and launched a task with a name > 255 characters through our own custom framework.
> 
> ```
> I0410 14:04:15.761109 28528 master.cpp:6323] Sending status update TASK_ERROR for task tesijetjijwtjwitjweitjweitjwitjweitjtijeiojwetoijetweoijwilgjwkdgsjskd.nlskdgnldksnglsdkgndslgjdslgjsdlgjldskgjsdlkgjslkgjslkdgjsdlkgjskldgjweiojgoeiwgjweoigjewoitjweoitjewiotjewitjweitjewitjwewejiowejiewtiwethewothweuothewouthuthwouthwuothgwuoghwouhweouthewhtiewtwetwhtohwethwetwehtwehtwjethwejlthwejlthwejhtwejthwejkthwejkthwejkthwejthwkthwekthwtkjwthkwjehtjkwehtkjwehtkjwehtkjwehtkwejhtewjkthewkjthewjkthwekjthwekjthwekjthwekjthwekjhtwekhtewkapplication227741021670-4A491BFF-F50D-4F17-B304-AD23423F15EE of framework 9e8d9439-7ed2-4968-a8cb-f46273c2d9af-0000 'ID must not be greater than 255 characters'
> ```
> 
> 
> Thanks,
> 
> Aaron Wood
> 
>


Re: Review Request 58317: Prevent agent from crashing when the ID is longer than the maximum file name length.

Posted by Jie Yu <yu...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/58317/#review171505
-----------------------------------------------------------


Fix it, then Ship it!





src/common/validation.cpp
Lines 21 (patched)
<https://reviews.apache.org/r/58317/#comment244439>

    See style guide. We include c headers ahead of C++ headers.



src/common/validation.cpp
Lines 42 (patched)
<https://reviews.apache.org/r/58317/#comment244438>

    255? Cau you use NAME_MAX in the error message as well?


- Jie Yu


On April 10, 2017, 10:37 p.m., Aaron Wood wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/58317/
> -----------------------------------------------------------
> 
> (Updated April 10, 2017, 10:37 p.m.)
> 
> 
> Review request for mesos, Jie Yu and James Peach.
> 
> 
> Bugs: MESOS-7346
>     https://issues.apache.org/jira/browse/MESOS-7346
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> When launching a task with a very long name `mkdir` will fail and crash the agent, making it quick and easy to remotely crash any agent(s). This changes makes sure that we never exceed the default file name limit of most of the file systems out there. If the limit is exceed a `TASK_ERROR` is instead sent back to the client.
> 
> 
> Diffs
> -----
> 
>   src/common/validation.cpp 544d3a0bf 
> 
> 
> Diff: https://reviews.apache.org/r/58317/diff/2/
> 
> 
> Testing
> -------
> 
> Built Mesos, ran 1 master and 1 agent locally, and launched a task with a name > 255 characters through our own custom framework.
> 
> ```
> I0410 14:04:15.761109 28528 master.cpp:6323] Sending status update TASK_ERROR for task tesijetjijwtjwitjweitjweitjwitjweitjtijeiojwetoijetweoijwilgjwkdgsjskd.nlskdgnldksnglsdkgndslgjdslgjsdlgjldskgjsdlkgjslkgjslkdgjsdlkgjskldgjweiojgoeiwgjweoigjewoitjweoitjewiotjewitjweitjewitjwewejiowejiewtiwethewothweuothewouthuthwouthwuothgwuoghwouhweouthewhtiewtwetwhtohwethwetwehtwehtwjethwejlthwejlthwejhtwejthwejkthwejkthwejkthwejthwkthwekthwtkjwthkwjehtjkwehtkjwehtkjwehtkjwehtkwejhtewjkthewkjthewjkthwekjthwekjthwekjthwekjthwekjhtwekhtewkapplication227741021670-4A491BFF-F50D-4F17-B304-AD23423F15EE of framework 9e8d9439-7ed2-4968-a8cb-f46273c2d9af-0000 'ID must not be greater than 255 characters'
> ```
> 
> 
> Thanks,
> 
> Aaron Wood
> 
>


Re: Review Request 58317: Prevent agent from crashing when the ID is longer than the maximum file name length.

Posted by Aaron Wood via Review Board <no...@reviews.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/58317/
-----------------------------------------------------------

(Updated April 11, 2017, 3:14 p.m.)


Review request for mesos, Jie Yu and James Peach.


Changes
-------

Use `NAME_MAX` in the error message and reorder C header.


Bugs: MESOS-7346
    https://issues.apache.org/jira/browse/MESOS-7346


Repository: mesos


Description
-------

When launching a task with a very long name `mkdir` will fail and crash the agent, making it quick and easy to remotely crash any agent(s). This changes makes sure that we never exceed the default file name limit of most of the file systems out there. If the limit is exceed a `TASK_ERROR` is instead sent back to the client.


Diffs (updated)
-----

  src/common/validation.cpp 544d3a0bf 


Diff: https://reviews.apache.org/r/58317/diff/3/

Changes: https://reviews.apache.org/r/58317/diff/2-3/


Testing
-------

Built Mesos, ran 1 master and 1 agent locally, and launched a task with a name > 255 characters through our own custom framework.

```
I0410 14:04:15.761109 28528 master.cpp:6323] Sending status update TASK_ERROR for task tesijetjijwtjwitjweitjweitjwitjweitjtijeiojwetoijetweoijwilgjwkdgsjskd.nlskdgnldksnglsdkgndslgjdslgjsdlgjldskgjsdlkgjslkgjslkdgjsdlkgjskldgjweiojgoeiwgjweoigjewoitjweoitjewiotjewitjweitjewitjwewejiowejiewtiwethewothweuothewouthuthwouthwuothgwuoghwouhweouthewhtiewtwetwhtohwethwetwehtwehtwjethwejlthwejlthwejhtwejthwejkthwejkthwejkthwejthwkthwekthwtkjwthkwjehtjkwehtkjwehtkjwehtkjwehtkwejhtewjkthewkjthewjkthwekjthwekjthwekjthwekjthwekjhtwekhtewkapplication227741021670-4A491BFF-F50D-4F17-B304-AD23423F15EE of framework 9e8d9439-7ed2-4968-a8cb-f46273c2d9af-0000 'ID must not be greater than 255 characters'
```


Thanks,

Aaron Wood


Re: Review Request 58317: Prevent agent from crashing when the ID is longer than the maximum file name length.

Posted by Mesos Reviewbot <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/58317/#review171524
-----------------------------------------------------------



Patch looks great!

Reviews applied: [58317]

Passed command: export OS='ubuntu:14.04' BUILDTOOL='autotools' COMPILER='gcc' CONFIGURATION='--verbose' ENVIRONMENT='GLOG_v=1 MESOS_VERBOSE=1'; ./support/docker-build.sh

- Mesos Reviewbot


On April 10, 2017, 3:37 p.m., Aaron Wood wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/58317/
> -----------------------------------------------------------
> 
> (Updated April 10, 2017, 3:37 p.m.)
> 
> 
> Review request for mesos, Jie Yu and James Peach.
> 
> 
> Bugs: MESOS-7346
>     https://issues.apache.org/jira/browse/MESOS-7346
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> When launching a task with a very long name `mkdir` will fail and crash the agent, making it quick and easy to remotely crash any agent(s). This changes makes sure that we never exceed the default file name limit of most of the file systems out there. If the limit is exceed a `TASK_ERROR` is instead sent back to the client.
> 
> 
> Diffs
> -----
> 
>   src/common/validation.cpp 544d3a0bf 
> 
> 
> Diff: https://reviews.apache.org/r/58317/diff/2/
> 
> 
> Testing
> -------
> 
> Built Mesos, ran 1 master and 1 agent locally, and launched a task with a name > 255 characters through our own custom framework.
> 
> ```
> I0410 14:04:15.761109 28528 master.cpp:6323] Sending status update TASK_ERROR for task tesijetjijwtjwitjweitjweitjwitjweitjtijeiojwetoijetweoijwilgjwkdgsjskd.nlskdgnldksnglsdkgndslgjdslgjsdlgjldskgjsdlkgjslkgjslkdgjsdlkgjskldgjweiojgoeiwgjweoigjewoitjweoitjewiotjewitjweitjewitjwewejiowejiewtiwethewothweuothewouthuthwouthwuothgwuoghwouhweouthewhtiewtwetwhtohwethwetwehtwehtwjethwejlthwejlthwejhtwejthwejkthwejkthwejkthwejthwkthwekthwtkjwthkwjehtjkwehtkjwehtkjwehtkjwehtkwejhtewjkthewkjthewjkthwekjthwekjthwekjthwekjthwekjhtwekhtewkapplication227741021670-4A491BFF-F50D-4F17-B304-AD23423F15EE of framework 9e8d9439-7ed2-4968-a8cb-f46273c2d9af-0000 'ID must not be greater than 255 characters'
> ```
> 
> 
> Thanks,
> 
> Aaron Wood
> 
>


Re: Review Request 58317: Prevent agent from crashing when the ID is longer than the maximum file name length.

Posted by Aaron Wood via Review Board <no...@reviews.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/58317/
-----------------------------------------------------------

(Updated April 10, 2017, 10:37 p.m.)


Review request for mesos, Jie Yu and James Peach.


Changes
-------

Use `NAME_MAX` instead of a hardcoded number.


Bugs: MESOS-7346
    https://issues.apache.org/jira/browse/MESOS-7346


Repository: mesos


Description
-------

When launching a task with a very long name `mkdir` will fail and crash the agent, making it quick and easy to remotely crash any agent(s). This changes makes sure that we never exceed the default file name limit of most of the file systems out there. If the limit is exceed a `TASK_ERROR` is instead sent back to the client.


Diffs (updated)
-----

  src/common/validation.cpp 544d3a0bf 


Diff: https://reviews.apache.org/r/58317/diff/2/

Changes: https://reviews.apache.org/r/58317/diff/1-2/


Testing
-------

Built Mesos, ran 1 master and 1 agent locally, and launched a task with a name > 255 characters through our own custom framework.

```
I0410 14:04:15.761109 28528 master.cpp:6323] Sending status update TASK_ERROR for task tesijetjijwtjwitjweitjweitjwitjweitjtijeiojwetoijetweoijwilgjwkdgsjskd.nlskdgnldksnglsdkgndslgjdslgjsdlgjldskgjsdlkgjslkgjslkdgjsdlkgjskldgjweiojgoeiwgjweoigjewoitjweoitjewiotjewitjweitjewitjwewejiowejiewtiwethewothweuothewouthuthwouthwuothgwuoghwouhweouthewhtiewtwetwhtohwethwetwehtwehtwjethwejlthwejlthwejhtwejthwejkthwejkthwejkthwejthwkthwekthwtkjwthkwjehtjkwehtkjwehtkjwehtkjwehtkwejhtewjkthewkjthewjkthwekjthwekjthwekjthwekjthwekjhtwekhtewkapplication227741021670-4A491BFF-F50D-4F17-B304-AD23423F15EE of framework 9e8d9439-7ed2-4968-a8cb-f46273c2d9af-0000 'ID must not be greater than 255 characters'
```


Thanks,

Aaron Wood


Re: Review Request 58317: Prevent agent from crashing when the ID is longer than the maximum file name length.

Posted by James Peach <jp...@apache.org>.

> On April 10, 2017, 9:05 p.m., Aaron Wood wrote:
> > src/common/validation.cpp
> > Lines 40 (patched)
> > <https://reviews.apache.org/r/58317/diff/1/?file=1687524#file1687524line40>
> >
> >     Maybe it's better to put this check in `src/slave/paths.cpp` and add up the length of `rootDir`, `slaveId`, `frameworkId`, `executorId`, and `containerId`? What I have here doesn't really guard against the entire path being > 255, only individual pieces.
> >     
> >     I could add this check around here:
> >     ```
> >       const string directory =
> >         getExecutorRunPath(rootDir, slaveId, frameworkId, executorId, containerId);
> >     
> >       Try<Nothing> mkdir = os::mkdir(directory);
> >     ```
> >     
> >     Thoughts?

The path is allowed to be > 255 (typically 4K on Linux).


- James


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


On April 10, 2017, 6:16 p.m., Aaron Wood wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/58317/
> -----------------------------------------------------------
> 
> (Updated April 10, 2017, 6:16 p.m.)
> 
> 
> Review request for mesos, Jie Yu and James Peach.
> 
> 
> Bugs: MESOS-7346
>     https://issues.apache.org/jira/browse/MESOS-7346
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> When launching a task with a very long name `mkdir` will fail and crash the agent, making it quick and easy to remotely crash any agent(s). This changes makes sure that we never exceed the default file name limit of most of the file systems out there. If the limit is exceed a `TASK_ERROR` is instead sent back to the client.
> 
> 
> Diffs
> -----
> 
>   src/common/validation.cpp 544d3a0bf 
> 
> 
> Diff: https://reviews.apache.org/r/58317/diff/1/
> 
> 
> Testing
> -------
> 
> Built Mesos, ran 1 master and 1 agent locally, and launched a task with a name > 255 characters through our own custom framework.
> 
> ```
> I0410 14:04:15.761109 28528 master.cpp:6323] Sending status update TASK_ERROR for task tesijetjijwtjwitjweitjweitjwitjweitjtijeiojwetoijetweoijwilgjwkdgsjskd.nlskdgnldksnglsdkgndslgjdslgjsdlgjldskgjsdlkgjslkgjslkdgjsdlkgjskldgjweiojgoeiwgjweoigjewoitjweoitjewiotjewitjweitjewitjwewejiowejiewtiwethewothweuothewouthuthwouthwuothgwuoghwouhweouthewhtiewtwetwhtohwethwetwehtwehtwjethwejlthwejlthwejhtwejthwejkthwejkthwejkthwejthwkthwekthwtkjwthkwjehtjkwehtkjwehtkjwehtkjwehtkwejhtewjkthewkjthewjkthwekjthwekjthwekjthwekjthwekjhtwekhtewkapplication227741021670-4A491BFF-F50D-4F17-B304-AD23423F15EE of framework 9e8d9439-7ed2-4968-a8cb-f46273c2d9af-0000 'ID must not be greater than 255 characters'
> ```
> 
> 
> Thanks,
> 
> Aaron Wood
> 
>


Re: Review Request 58317: Prevent agent from crashing when the ID is longer than the maximum file name length.

Posted by Aaron Wood via Review Board <no...@reviews.apache.org>.

> On April 10, 2017, 9:05 p.m., Aaron Wood wrote:
> > src/common/validation.cpp
> > Lines 40 (patched)
> > <https://reviews.apache.org/r/58317/diff/1/?file=1687524#file1687524line40>
> >
> >     Maybe it's better to put this check in `src/slave/paths.cpp` and add up the length of `rootDir`, `slaveId`, `frameworkId`, `executorId`, and `containerId`? What I have here doesn't really guard against the entire path being > 255, only individual pieces.
> >     
> >     I could add this check around here:
> >     ```
> >       const string directory =
> >         getExecutorRunPath(rootDir, slaveId, frameworkId, executorId, containerId);
> >     
> >       Try<Nothing> mkdir = os::mkdir(directory);
> >     ```
> >     
> >     Thoughts?
> 
> James Peach wrote:
>     The path is allowed to be > 255 (typically 4K on Linux).

Ah, you're right. Looks like this check should be good enough then!


- Aaron


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


On April 10, 2017, 6:16 p.m., Aaron Wood wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/58317/
> -----------------------------------------------------------
> 
> (Updated April 10, 2017, 6:16 p.m.)
> 
> 
> Review request for mesos, Jie Yu and James Peach.
> 
> 
> Bugs: MESOS-7346
>     https://issues.apache.org/jira/browse/MESOS-7346
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> When launching a task with a very long name `mkdir` will fail and crash the agent, making it quick and easy to remotely crash any agent(s). This changes makes sure that we never exceed the default file name limit of most of the file systems out there. If the limit is exceed a `TASK_ERROR` is instead sent back to the client.
> 
> 
> Diffs
> -----
> 
>   src/common/validation.cpp 544d3a0bf 
> 
> 
> Diff: https://reviews.apache.org/r/58317/diff/1/
> 
> 
> Testing
> -------
> 
> Built Mesos, ran 1 master and 1 agent locally, and launched a task with a name > 255 characters through our own custom framework.
> 
> ```
> I0410 14:04:15.761109 28528 master.cpp:6323] Sending status update TASK_ERROR for task tesijetjijwtjwitjweitjweitjwitjweitjtijeiojwetoijetweoijwilgjwkdgsjskd.nlskdgnldksnglsdkgndslgjdslgjsdlgjldskgjsdlkgjslkgjslkdgjsdlkgjskldgjweiojgoeiwgjweoigjewoitjweoitjewiotjewitjweitjewitjwewejiowejiewtiwethewothweuothewouthuthwouthwuothgwuoghwouhweouthewhtiewtwetwhtohwethwetwehtwehtwjethwejlthwejlthwejhtwejthwejkthwejkthwejkthwejthwkthwekthwtkjwthkwjehtjkwehtkjwehtkjwehtkjwehtkwejhtewjkthewkjthewjkthwekjthwekjthwekjthwekjthwekjhtwekhtewkapplication227741021670-4A491BFF-F50D-4F17-B304-AD23423F15EE of framework 9e8d9439-7ed2-4968-a8cb-f46273c2d9af-0000 'ID must not be greater than 255 characters'
> ```
> 
> 
> Thanks,
> 
> Aaron Wood
> 
>


Re: Review Request 58317: Prevent agent from crashing when the ID is longer than the maximum file name length.

Posted by Aaron Wood via Review Board <no...@reviews.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/58317/#review171483
-----------------------------------------------------------




src/common/validation.cpp
Lines 40 (patched)
<https://reviews.apache.org/r/58317/#comment244418>

    Maybe it's better to put this check in `src/slave/paths.cpp` and add up the length of `rootDir`, `slaveId`, `frameworkId`, `executorId`, and `containerId`? What I have here doesn't really guard against the entire path being > 255, only individual pieces.
    
    I could add this check around here:
    ```
      const string directory =
        getExecutorRunPath(rootDir, slaveId, frameworkId, executorId, containerId);
    
      Try<Nothing> mkdir = os::mkdir(directory);
    ```
    
    Thoughts?


- Aaron Wood


On April 10, 2017, 6:16 p.m., Aaron Wood wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/58317/
> -----------------------------------------------------------
> 
> (Updated April 10, 2017, 6:16 p.m.)
> 
> 
> Review request for mesos, Jie Yu and James Peach.
> 
> 
> Bugs: MESOS-7346
>     https://issues.apache.org/jira/browse/MESOS-7346
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> When launching a task with a very long name `mkdir` will fail and crash the agent, making it quick and easy to remotely crash any agent(s). This changes makes sure that we never exceed the default file name limit of most of the file systems out there. If the limit is exceed a `TASK_ERROR` is instead sent back to the client.
> 
> 
> Diffs
> -----
> 
>   src/common/validation.cpp 544d3a0bf 
> 
> 
> Diff: https://reviews.apache.org/r/58317/diff/1/
> 
> 
> Testing
> -------
> 
> Built Mesos, ran 1 master and 1 agent locally, and launched a task with a name > 255 characters through our own custom framework.
> 
> ```
> I0410 14:04:15.761109 28528 master.cpp:6323] Sending status update TASK_ERROR for task tesijetjijwtjwitjweitjweitjwitjweitjtijeiojwetoijetweoijwilgjwkdgsjskd.nlskdgnldksnglsdkgndslgjdslgjsdlgjldskgjsdlkgjslkgjslkdgjsdlkgjskldgjweiojgoeiwgjweoigjewoitjweoitjewiotjewitjweitjewitjwewejiowejiewtiwethewothweuothewouthuthwouthwuothgwuoghwouhweouthewhtiewtwetwhtohwethwetwehtwehtwjethwejlthwejlthwejhtwejthwejkthwejkthwejkthwejthwkthwekthwtkjwthkwjehtjkwehtkjwehtkjwehtkjwehtkwejhtewjkthewkjthewjkthwekjthwekjthwekjthwekjthwekjhtwekhtewkapplication227741021670-4A491BFF-F50D-4F17-B304-AD23423F15EE of framework 9e8d9439-7ed2-4968-a8cb-f46273c2d9af-0000 'ID must not be greater than 255 characters'
> ```
> 
> 
> Thanks,
> 
> Aaron Wood
> 
>


Re: Review Request 58317: Prevent agent from crashing when the ID is longer than the maximum file name length.

Posted by Aaron Wood via Review Board <no...@reviews.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/58317/#review171456
-----------------------------------------------------------




src/common/validation.cpp
Line 46 (original), 50 (patched)
<https://reviews.apache.org/r/58317/#comment244396>

    I figured I'd fix this spelling error while I was here.


- Aaron Wood


On April 10, 2017, 6:16 p.m., Aaron Wood wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/58317/
> -----------------------------------------------------------
> 
> (Updated April 10, 2017, 6:16 p.m.)
> 
> 
> Review request for mesos, Jie Yu and James Peach.
> 
> 
> Bugs: MESOS-7346
>     https://issues.apache.org/jira/browse/MESOS-7346
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> When launching a task with a very long name `mkdir` will fail and crash the agent, making it quick and easy to remotely crash any agent(s). This changes makes sure that we never exceed the default file name limit of most of the file systems out there. If the limit is exceed a `TASK_ERROR` is instead sent back to the client.
> 
> 
> Diffs
> -----
> 
>   src/common/validation.cpp 544d3a0bf 
> 
> 
> Diff: https://reviews.apache.org/r/58317/diff/1/
> 
> 
> Testing
> -------
> 
> Built Mesos, ran 1 master and 1 agent locally, and launched a task with a name > 255 characters through our own custom framework.
> 
> ```
> I0410 14:04:15.761109 28528 master.cpp:6323] Sending status update TASK_ERROR for task tesijetjijwtjwitjweitjweitjwitjweitjtijeiojwetoijetweoijwilgjwkdgsjskd.nlskdgnldksnglsdkgndslgjdslgjsdlgjldskgjsdlkgjslkgjslkdgjsdlkgjskldgjweiojgoeiwgjweoigjewoitjweoitjewiotjewitjweitjewitjwewejiowejiewtiwethewothweuothewouthuthwouthwuothgwuoghwouhweouthewhtiewtwetwhtohwethwetwehtwehtwjethwejlthwejlthwejhtwejthwejkthwejkthwejkthwejthwkthwekthwtkjwthkwjehtjkwehtkjwehtkjwehtkjwehtkwejhtewjkthewkjthewjkthwekjthwekjthwekjthwekjthwekjhtwekhtewkapplication227741021670-4A491BFF-F50D-4F17-B304-AD23423F15EE of framework 9e8d9439-7ed2-4968-a8cb-f46273c2d9af-0000 'ID must not be greater than 255 characters'
> ```
> 
> 
> Thanks,
> 
> Aaron Wood
> 
>