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/14 20:49:53 UTC

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

-----------------------------------------------------------
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: 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