You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Joseph Wu <jo...@mesosphere.io> on 2016/01/05 03:21:30 UTC

Re: Review Request 41783: Logger Module: Implement the rotating container logger module.

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

(Updated Jan. 4, 2016, 6:21 p.m.)


Review request for mesos, Benjamin Hindman and Artem Harutyunyan.


Changes
-------

Use stout::Flags.  Added lots more flags + comments.  A bunch of cleanup + addressing comments.


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


Repository: mesos


Description
-------

Adds a non-default ContainerLogger that constrains total log size by rotating logs (i.e. renaming the head log file).


Diffs (updated)
-----

  src/slave/container_loggers/rotate.hpp PRE-CREATION 
  src/slave/container_loggers/rotate.cpp PRE-CREATION 
  src/slave/container_loggers/rotating.hpp PRE-CREATION 
  src/slave/container_loggers/rotating.cpp PRE-CREATION 

Diff: https://reviews.apache.org/r/41783/diff/


Testing
-------

make check


Thanks,

Joseph Wu


Re: Review Request 41783: Logger Module: Implement the rotating container logger module.

Posted by Joseph Wu <jo...@mesosphere.io>.

> On Jan. 4, 2016, 10:30 p.m., Mesos ReviewBot wrote:
> > Bad patch!
> > 
> > Reviews applied: [41002, 41003, 41004, 41061, 41111, 41166, 41167, 41169, 41560, 41294, 41370, 41378, 41779]
> > 
> > Failed command: ./support/apply-review.sh -n -r 41779
> > 
> > Error:
> >  2016-01-05 06:30:37 URL:https://reviews.apache.org/r/41779/diff/raw/ [3222/3222] -> "41779.patch" [1]
> > Total errors found: 0
> > Checking 2 files
> > Error: Commit message summary (the first line) must not exceed 72 characters.

Shortened a couple of summary messages (3 of them were over 72 characters :).


- Joseph


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


On Jan. 4, 2016, 6:21 p.m., Joseph Wu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41783/
> -----------------------------------------------------------
> 
> (Updated Jan. 4, 2016, 6:21 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Artem Harutyunyan.
> 
> 
> Bugs: MESOS-4136
>     https://issues.apache.org/jira/browse/MESOS-4136
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Adds a non-default ContainerLogger that constrains total log size by rotating logs (i.e. renaming the head log file).
> 
> 
> Diffs
> -----
> 
>   src/slave/container_loggers/rotate.hpp PRE-CREATION 
>   src/slave/container_loggers/rotate.cpp PRE-CREATION 
>   src/slave/container_loggers/rotating.hpp PRE-CREATION 
>   src/slave/container_loggers/rotating.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/41783/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Joseph Wu
> 
>


Re: Review Request 41783: Logger Module: Implement the rotating container logger module.

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


Bad patch!

Reviews applied: [41002, 41003, 41004, 41061, 41111, 41166, 41167, 41169, 41560, 41294, 41370, 41378, 41779]

Failed command: ./support/apply-review.sh -n -r 41779

Error:
 2016-01-05 06:30:37 URL:https://reviews.apache.org/r/41779/diff/raw/ [3222/3222] -> "41779.patch" [1]
Total errors found: 0
Checking 2 files
Error: Commit message summary (the first line) must not exceed 72 characters.

- Mesos ReviewBot


On Jan. 5, 2016, 2:21 a.m., Joseph Wu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41783/
> -----------------------------------------------------------
> 
> (Updated Jan. 5, 2016, 2:21 a.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Artem Harutyunyan.
> 
> 
> Bugs: MESOS-4136
>     https://issues.apache.org/jira/browse/MESOS-4136
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Adds a non-default ContainerLogger that constrains total log size by rotating logs (i.e. renaming the head log file).
> 
> 
> Diffs
> -----
> 
>   src/slave/container_loggers/rotate.hpp PRE-CREATION 
>   src/slave/container_loggers/rotate.cpp PRE-CREATION 
>   src/slave/container_loggers/rotating.hpp PRE-CREATION 
>   src/slave/container_loggers/rotating.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/41783/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Joseph Wu
> 
>


Re: Review Request 41783: Logger Module: Implement the rotating container logger module.

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


Patch looks great!

Reviews applied: [41002, 41003, 41004, 41061, 41111, 41166, 41167, 41169, 41560, 41294, 41370, 41378, 41779, 41780, 41781, 41782, 41783]

Passed command: export OS=ubuntu:14.04;export CONFIGURATION="--verbose";export COMPILER=gcc; ./support/docker_build.sh

- Mesos ReviewBot


On Jan. 5, 2016, 7:05 p.m., Joseph Wu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41783/
> -----------------------------------------------------------
> 
> (Updated Jan. 5, 2016, 7:05 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Artem Harutyunyan.
> 
> 
> Bugs: MESOS-4136
>     https://issues.apache.org/jira/browse/MESOS-4136
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Adds a non-default ContainerLogger that constrains total log size by rotating logs (i.e. renaming the head log file).
> 
> 
> Diffs
> -----
> 
>   src/slave/container_loggers/rotate.hpp PRE-CREATION 
>   src/slave/container_loggers/rotate.cpp PRE-CREATION 
>   src/slave/container_loggers/rotating.hpp PRE-CREATION 
>   src/slave/container_loggers/rotating.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/41783/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Joseph Wu
> 
>


Re: Review Request 41783: Logger Module: Implement the rotating container logger module.

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


Patch looks great!

Reviews applied: [41002, 41003, 41004, 41061, 41111, 41166, 41167, 41169, 41560, 41294, 41370, 41378, 41779, 41780, 41781, 41782, 41783]

Passed command: export OS=ubuntu:14.04;export CONFIGURATION="--verbose";export COMPILER=gcc; ./support/docker_build.sh

- Mesos ReviewBot


On Jan. 8, 2016, 8:06 p.m., Joseph Wu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41783/
> -----------------------------------------------------------
> 
> (Updated Jan. 8, 2016, 8:06 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Artem Harutyunyan.
> 
> 
> Bugs: MESOS-4136
>     https://issues.apache.org/jira/browse/MESOS-4136
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Adds a non-default ContainerLogger that constrains total log size by rotating logs (i.e. renaming the head log file).
> 
> 
> Diffs
> -----
> 
>   src/slave/container_loggers/rotate.hpp PRE-CREATION 
>   src/slave/container_loggers/rotate.cpp PRE-CREATION 
>   src/slave/container_loggers/rotating.hpp PRE-CREATION 
>   src/slave/container_loggers/rotating.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/41783/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Joseph Wu
> 
>


Re: Review Request 41783: Logger Module: Implement the rotating container logger module.

Posted by Joseph Wu <jo...@mesosphere.io>.

> On Jan. 13, 2016, 9:03 p.m., Benjamin Hindman wrote:
> > src/slave/container_loggers/rotating.cpp, lines 148-151
> > <https://reviews.apache.org/r/41783/diff/5/?file=1196238#file1196238line148>
> >
> >     Why not do this in the constructor and then no need for the `if (process.get() != NULL) {` everywhere?

Do you mean to remove the not-initialized and double-initialize checks?

Note: The already committed Sandbox ContainerLogger also does this.  As well as the oversubscription modules.


- Joseph


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


On Jan. 13, 2016, 6:12 p.m., Joseph Wu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41783/
> -----------------------------------------------------------
> 
> (Updated Jan. 13, 2016, 6:12 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Artem Harutyunyan.
> 
> 
> Bugs: MESOS-4136
>     https://issues.apache.org/jira/browse/MESOS-4136
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Adds a non-default ContainerLogger that constrains total log size by rotating logs (i.e. renaming the head log file).
> 
> 
> Diffs
> -----
> 
>   src/slave/container_loggers/rotate.hpp PRE-CREATION 
>   src/slave/container_loggers/rotate.cpp PRE-CREATION 
>   src/slave/container_loggers/rotating.hpp PRE-CREATION 
>   src/slave/container_loggers/rotating.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/41783/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Joseph Wu
> 
>


Re: Review Request 41783: Logger Module: Implement the rotating container logger module.

Posted by Benjamin Hindman <be...@berkeley.edu>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41783/#review114410
-----------------------------------------------------------



src/slave/container_loggers/rotating.hpp (line 103)
<https://reviews.apache.org/r/41783/#comment175248>

    { on newline please.



src/slave/container_loggers/rotating.cpp (lines 148 - 151)
<https://reviews.apache.org/r/41783/#comment175249>

    Why not do this in the constructor and then no need for the `if (process.get() != NULL) {` everywhere?


- Benjamin Hindman


On Jan. 14, 2016, 2:12 a.m., Joseph Wu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41783/
> -----------------------------------------------------------
> 
> (Updated Jan. 14, 2016, 2:12 a.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Artem Harutyunyan.
> 
> 
> Bugs: MESOS-4136
>     https://issues.apache.org/jira/browse/MESOS-4136
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Adds a non-default ContainerLogger that constrains total log size by rotating logs (i.e. renaming the head log file).
> 
> 
> Diffs
> -----
> 
>   src/slave/container_loggers/rotate.hpp PRE-CREATION 
>   src/slave/container_loggers/rotate.cpp PRE-CREATION 
>   src/slave/container_loggers/rotating.hpp PRE-CREATION 
>   src/slave/container_loggers/rotating.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/41783/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Joseph Wu
> 
>


Re: Review Request 41783: Implement the rotating container logger module.

Posted by Benjamin Hindman <be...@berkeley.edu>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41783/#review115318
-----------------------------------------------------------



src/slave/container_loggers/rotate.cpp (lines 128 - 131)
<https://reviews.apache.org/r/41783/#comment176288>

    Future<Nothing> loop()
    {
      return io::read(STDIN_FILENO, buffer, length)
        .then([&](size_t readSize) -> Future<Nothing> {
          // ... comment here ...
          if (readSize <= 0) {
              EXIT(EXIT_SUCCESS);
          }
          Try<Nothing> result = write(buffer, size);
          if (result.isError()) {
            return Error();
          }
          return dispatch(self(), &RotateLoggerProcess::loop);
    }
    
    Try<Nothing> write(buffer, size)
    {
      if file is closed: if (leading.isNone()) {
        // open the leading file
        // deal with errors
      }
      
      if (need_to_rotate) {
        rotate();
        return write(buffer, size);
      }
      
      ... do the actual write ...
      return Nothing();
    }


- Benjamin Hindman


On Jan. 16, 2016, 12:54 a.m., Joseph Wu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41783/
> -----------------------------------------------------------
> 
> (Updated Jan. 16, 2016, 12:54 a.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Artem Harutyunyan.
> 
> 
> Bugs: MESOS-4136
>     https://issues.apache.org/jira/browse/MESOS-4136
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Implement the rotating container logger module.
> 
> 
> Diffs
> -----
> 
>   src/slave/container_loggers/rotate.hpp PRE-CREATION 
>   src/slave/container_loggers/rotate.cpp PRE-CREATION 
>   src/slave/container_loggers/rotating.hpp PRE-CREATION 
>   src/slave/container_loggers/rotating.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/41783/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Joseph Wu
> 
>


Re: Review Request 41783: Logger Module: Implement the rotating container logger module.

Posted by Benjamin Hindman <be...@berkeley.edu>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41783/#review116041
-----------------------------------------------------------


Fix it, then Ship it!




I'll fix up the issue below and commit, thanks!


src/slave/container_loggers/logrotate.cpp (line 107)
<https://reviews.apache.org/r/41783/#comment177055>

    { on newline please.


- Benjamin Hindman


On Jan. 23, 2016, 9:07 a.m., Joseph Wu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41783/
> -----------------------------------------------------------
> 
> (Updated Jan. 23, 2016, 9:07 a.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Artem Harutyunyan.
> 
> 
> Bugs: MESOS-4136
>     https://issues.apache.org/jira/browse/MESOS-4136
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Adds a non-default ContainerLogger that constrains total log size by rotating logs (i.e. renaming the head log file).
> 
> 
> Diffs
> -----
> 
>   src/slave/container_loggers/lib_logrotate.hpp PRE-CREATION 
>   src/slave/container_loggers/lib_logrotate.cpp PRE-CREATION 
>   src/slave/container_loggers/logrotate.hpp PRE-CREATION 
>   src/slave/container_loggers/logrotate.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/41783/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Joseph Wu
> 
>


Re: Review Request 41783: Logger Module: Implement the rotating container logger module.

Posted by Shuai Lin <li...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41783/#review115993
-----------------------------------------------------------




src/slave/container_loggers/lib_logrotate.hpp (line 106)
<https://reviews.apache.org/r/41783/#comment177031>

    nitpick: "--version 2>/dev/null"



src/slave/container_loggers/logrotate.cpp (line 55)
<https://reviews.apache.org/r/41783/#comment177032>

    nitpick: rename `length` to something like `buflenth`, which could be more intuitive.


- Shuai Lin


On Jan. 23, 2016, 9:07 a.m., Joseph Wu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41783/
> -----------------------------------------------------------
> 
> (Updated Jan. 23, 2016, 9:07 a.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Artem Harutyunyan.
> 
> 
> Bugs: MESOS-4136
>     https://issues.apache.org/jira/browse/MESOS-4136
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Adds a non-default ContainerLogger that constrains total log size by rotating logs (i.e. renaming the head log file).
> 
> 
> Diffs
> -----
> 
>   src/slave/container_loggers/lib_logrotate.hpp PRE-CREATION 
>   src/slave/container_loggers/lib_logrotate.cpp PRE-CREATION 
>   src/slave/container_loggers/logrotate.hpp PRE-CREATION 
>   src/slave/container_loggers/logrotate.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/41783/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Joseph Wu
> 
>


Re: Review Request 41783: Logger Module: Implement the rotating container logger module.

Posted by Joseph Wu <jo...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41783/
-----------------------------------------------------------

(Updated Jan. 23, 2016, 1:07 a.m.)


Review request for mesos, Benjamin Hindman and Artem Harutyunyan.


Changes
-------

Cleaned up some headers.
Refactored `logrotate.cpp` a little (BenH's suggestions).
Added quotation marks inside the `logrotate` command and configuration file.
Added a `setsid` call such that the logger subprocess will not exit if the agent terminates.


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


Repository: mesos


Description
-------

Adds a non-default ContainerLogger that constrains total log size by rotating logs (i.e. renaming the head log file).


Diffs (updated)
-----

  src/slave/container_loggers/lib_logrotate.hpp PRE-CREATION 
  src/slave/container_loggers/lib_logrotate.cpp PRE-CREATION 
  src/slave/container_loggers/logrotate.hpp PRE-CREATION 
  src/slave/container_loggers/logrotate.cpp PRE-CREATION 

Diff: https://reviews.apache.org/r/41783/diff/


Testing
-------

make check


Thanks,

Joseph Wu


Re: Review Request 41783: Logger Module: Implement the rotating container logger module.

Posted by Joseph Wu <jo...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41783/
-----------------------------------------------------------

(Updated Jan. 22, 2016, 7:04 p.m.)


Review request for mesos, Benjamin Hindman and Artem Harutyunyan.


Changes
-------

Fix bug with launching the subprocess with the agent's environment.
Change subprocess's looping to have a future chain of max length 2.


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


Repository: mesos


Description
-------

Adds a non-default ContainerLogger that constrains total log size by rotating logs (i.e. renaming the head log file).


Diffs (updated)
-----

  src/slave/container_loggers/lib_logrotate.hpp PRE-CREATION 
  src/slave/container_loggers/lib_logrotate.cpp PRE-CREATION 
  src/slave/container_loggers/logrotate.hpp PRE-CREATION 
  src/slave/container_loggers/logrotate.cpp PRE-CREATION 

Diff: https://reviews.apache.org/r/41783/diff/


Testing
-------

make check


Thanks,

Joseph Wu


Re: Review Request 41783: Logger Module: Implement the rotating container logger module.

Posted by Joseph Wu <jo...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41783/
-----------------------------------------------------------

(Updated Jan. 19, 2016, 7:41 p.m.)


Review request for mesos, Benjamin Hindman and Artem Harutyunyan.


Changes
-------

Rename from "rotate" to "logrotate".
Refactored rotate.cpp (now logrotate.cpp) a bit.


Summary (updated)
-----------------

Logger Module: Implement the rotating container logger module.


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


Repository: mesos


Description (updated)
-------

Adds a non-default ContainerLogger that constrains total log size by rotating logs (i.e. renaming the head log file).


Diffs (updated)
-----

  src/slave/container_loggers/lib_logrotate.hpp PRE-CREATION 
  src/slave/container_loggers/lib_logrotate.cpp PRE-CREATION 
  src/slave/container_loggers/logrotate.hpp PRE-CREATION 
  src/slave/container_loggers/logrotate.cpp PRE-CREATION 

Diff: https://reviews.apache.org/r/41783/diff/


Testing
-------

make check


Thanks,

Joseph Wu


Re: Review Request 41783: Implement the rotating container logger module.

Posted by Joseph Wu <jo...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41783/
-----------------------------------------------------------

(Updated Jan. 15, 2016, 4:54 p.m.)


Review request for mesos, Benjamin Hindman and Artem Harutyunyan.


Changes
-------

* Rework module implementation to use `logrotate` instead of custom logic.  
* * Removed the "number of files" flag in favor of a general "logrotate options" flag.
* * Gouged out the logic in `rotate.cpp` and replaced it with an `os::shell`.


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


Repository: mesos


Description
-------

Implement the rotating container logger module.


Diffs (updated)
-----

  src/slave/container_loggers/rotate.hpp PRE-CREATION 
  src/slave/container_loggers/rotate.cpp PRE-CREATION 
  src/slave/container_loggers/rotating.hpp PRE-CREATION 
  src/slave/container_loggers/rotating.cpp PRE-CREATION 

Diff: https://reviews.apache.org/r/41783/diff/


Testing
-------

make check


Thanks,

Joseph Wu


Re: Review Request 41783: Implement the rotating container logger module.

Posted by Joseph Wu <jo...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41783/
-----------------------------------------------------------

(Updated Jan. 15, 2016, 11:34 a.m.)


Review request for mesos, Benjamin Hindman and Artem Harutyunyan.


Changes
-------

Refactored `initialize` logic since the module is so simple (compared to other modules, like oversubscription).


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


Repository: mesos


Description
-------

Implement the rotating container logger module.


Diffs (updated)
-----

  src/slave/container_loggers/rotate.hpp PRE-CREATION 
  src/slave/container_loggers/rotate.cpp PRE-CREATION 
  src/slave/container_loggers/rotating.hpp PRE-CREATION 
  src/slave/container_loggers/rotating.cpp PRE-CREATION 

Diff: https://reviews.apache.org/r/41783/diff/


Testing
-------

make check


Thanks,

Joseph Wu


Re: Review Request 41783: Implement the rotating container logger module.

Posted by Joseph Wu <jo...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41783/
-----------------------------------------------------------

(Updated Jan. 14, 2016, 11:49 a.m.)


Review request for mesos, Benjamin Hindman and Artem Harutyunyan.


Changes
-------

Tweak some spacing.


Summary (updated)
-----------------

Implement the rotating container logger module.


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


Repository: mesos


Description (updated)
-------

Implement the rotating container logger module.


Diffs (updated)
-----

  src/slave/container_loggers/rotate.hpp PRE-CREATION 
  src/slave/container_loggers/rotate.cpp PRE-CREATION 
  src/slave/container_loggers/rotating.hpp PRE-CREATION 
  src/slave/container_loggers/rotating.cpp PRE-CREATION 

Diff: https://reviews.apache.org/r/41783/diff/


Testing
-------

make check


Thanks,

Joseph Wu


Re: Review Request 41783: Logger Module: Implement the rotating container logger module.

Posted by Joseph Wu <jo...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41783/
-----------------------------------------------------------

(Updated Jan. 13, 2016, 6:12 p.m.)


Review request for mesos, Benjamin Hindman and Artem Harutyunyan.


Changes
-------

* Reworked some flag comments.  Moved validation code into flags.
* Removed `logger_log_filename` flag in favor of printing to the agent's stderr upon (critical) failure.
* Changed types of `max_..._size` flags to `Bytes`.
* Renamed `outgoing` and `head` language to `leading`.


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


Repository: mesos


Description
-------

Adds a non-default ContainerLogger that constrains total log size by rotating logs (i.e. renaming the head log file).


Diffs (updated)
-----

  src/slave/container_loggers/rotate.hpp PRE-CREATION 
  src/slave/container_loggers/rotate.cpp PRE-CREATION 
  src/slave/container_loggers/rotating.hpp PRE-CREATION 
  src/slave/container_loggers/rotating.cpp PRE-CREATION 

Diff: https://reviews.apache.org/r/41783/diff/


Testing
-------

make check


Thanks,

Joseph Wu


Re: Review Request 41783: Logger Module: Implement the rotating container logger module.

Posted by Joseph Wu <jo...@mesosphere.io>.

> On Jan. 13, 2016, 11:25 a.m., Benjamin Hindman wrote:
> >

Note: I'm still gathering feedback regarding the naming scheme of the rotated logs.


> On Jan. 13, 2016, 11:25 a.m., Benjamin Hindman wrote:
> > src/slave/container_loggers/rotate.hpp, line 54
> > <https://reviews.apache.org/r/41783/diff/3/?file=1182155#file1182155line54>
> >
> >     How about s/of log/of rotated log/ here?
> >     
> >     Also, is 'head' better than 'current'? Just a suggestion, given that head sounds like "first", I thought by head you meant the oldest log file, not the newest.

"Current" doesn't fit very well in some comments, so I renamed to "Leading" instead.  (And renamed some variables.)


> On Jan. 13, 2016, 11:25 a.m., Benjamin Hindman wrote:
> > src/slave/container_loggers/rotate.cpp, lines 35-37
> > <https://reviews.apache.org/r/41783/diff/3/?file=1182156#file1182156line35>
> >
> >     These pulled out?

Yup, done in diff#4.


- Joseph


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


On Jan. 13, 2016, 6:12 p.m., Joseph Wu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41783/
> -----------------------------------------------------------
> 
> (Updated Jan. 13, 2016, 6:12 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Artem Harutyunyan.
> 
> 
> Bugs: MESOS-4136
>     https://issues.apache.org/jira/browse/MESOS-4136
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Adds a non-default ContainerLogger that constrains total log size by rotating logs (i.e. renaming the head log file).
> 
> 
> Diffs
> -----
> 
>   src/slave/container_loggers/rotate.hpp PRE-CREATION 
>   src/slave/container_loggers/rotate.cpp PRE-CREATION 
>   src/slave/container_loggers/rotating.hpp PRE-CREATION 
>   src/slave/container_loggers/rotating.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/41783/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Joseph Wu
> 
>


Re: Review Request 41783: Logger Module: Implement the rotating container logger module.

Posted by Benjamin Hindman <be...@berkeley.edu>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41783/#review113378
-----------------------------------------------------------



src/slave/container_loggers/rotate.hpp (line 36)
<https://reviews.apache.org/r/41783/#comment173976>

    { on newline please.



src/slave/container_loggers/rotate.hpp (lines 46 - 50)
<https://reviews.apache.org/r/41783/#comment173977>

    This should be `Bytes` rather than force the reader/user to write this in bytes (even if it's code that is generating this) and force you to use it as a `size_t`.
    
    Same for other flags you have here and below too please.



src/slave/container_loggers/rotate.hpp (line 54)
<https://reviews.apache.org/r/41783/#comment173979>

    How about s/of log/of rotated log/ here?
    
    Also, is 'head' better than 'current'? Just a suggestion, given that head sounds like "first", I thought by head you meant the oldest log file, not the newest.



src/slave/container_loggers/rotate.cpp (lines 35 - 37)
<https://reviews.apache.org/r/41783/#comment174225>

    These pulled out?



src/slave/container_loggers/rotate.cpp (lines 57 - 61)
<https://reviews.apache.org/r/41783/#comment174226>

    Can you send me another review which updates the version of `io::read` that you're using to `dup`, `os::cloexec`, and `os::nonblock` the file descriptor so we don't have to? Then we can kill this (and other places that use that version of `io::read` too!).



src/slave/container_loggers/rotate.cpp (lines 207 - 218)
<https://reviews.apache.org/r/41783/#comment175067>

    Want to do this validation in the flags themselves?



src/slave/container_loggers/rotating.hpp (line 49)
<https://reviews.apache.org/r/41783/#comment173975>

    How about:
    
    s/of stdout/of rotated stdout (i.e., stdout.1, stdout.2, ...)/


- Benjamin Hindman


On Jan. 8, 2016, 8:06 p.m., Joseph Wu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41783/
> -----------------------------------------------------------
> 
> (Updated Jan. 8, 2016, 8:06 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Artem Harutyunyan.
> 
> 
> Bugs: MESOS-4136
>     https://issues.apache.org/jira/browse/MESOS-4136
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Adds a non-default ContainerLogger that constrains total log size by rotating logs (i.e. renaming the head log file).
> 
> 
> Diffs
> -----
> 
>   src/slave/container_loggers/rotate.hpp PRE-CREATION 
>   src/slave/container_loggers/rotate.cpp PRE-CREATION 
>   src/slave/container_loggers/rotating.hpp PRE-CREATION 
>   src/slave/container_loggers/rotating.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/41783/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Joseph Wu
> 
>


Re: Review Request 41783: Logger Module: Implement the rotating container logger module.

Posted by Joseph Wu <jo...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41783/
-----------------------------------------------------------

(Updated Jan. 8, 2016, 12:06 p.m.)


Review request for mesos, Benjamin Hindman and Artem Harutyunyan.


Changes
-------

Fix module cleanup on failure in `prepare`.  Fix header order, some spacing.


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


Repository: mesos


Description
-------

Adds a non-default ContainerLogger that constrains total log size by rotating logs (i.e. renaming the head log file).


Diffs (updated)
-----

  src/slave/container_loggers/rotate.hpp PRE-CREATION 
  src/slave/container_loggers/rotate.cpp PRE-CREATION 
  src/slave/container_loggers/rotating.hpp PRE-CREATION 
  src/slave/container_loggers/rotating.cpp PRE-CREATION 

Diff: https://reviews.apache.org/r/41783/diff/


Testing
-------

make check


Thanks,

Joseph Wu


Re: Review Request 41783: Logger Module: Implement the rotating container logger module.

Posted by Joseph Wu <jo...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41783/
-----------------------------------------------------------

(Updated Jan. 5, 2016, 11:05 a.m.)


Review request for mesos, Benjamin Hindman and Artem Harutyunyan.


Changes
-------

Fix some signed comparisons.


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


Repository: mesos


Description
-------

Adds a non-default ContainerLogger that constrains total log size by rotating logs (i.e. renaming the head log file).


Diffs (updated)
-----

  src/slave/container_loggers/rotate.hpp PRE-CREATION 
  src/slave/container_loggers/rotate.cpp PRE-CREATION 
  src/slave/container_loggers/rotating.hpp PRE-CREATION 
  src/slave/container_loggers/rotating.cpp PRE-CREATION 

Diff: https://reviews.apache.org/r/41783/diff/


Testing
-------

make check


Thanks,

Joseph Wu