mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joseph Wu <jos...@mesosphere.io>
Subject Review Request 42865: Fixed LogrotateContainerLogger's FD ownership.
Date Wed, 27 Jan 2016 20:45:06 GMT

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

Review request for mesos, Benjamin Hindman and Artem Harutyunyan.


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


Repository: mesos


Description
-------

Releases ownership of pipe FDs from `Subprocess` before passing them into `Subprocess::FD(___,
IO::OWNED)`.  If ownership is not transferred, the pipe's FDs may be closed (again), which
may unexpectedly close random FDs belonging to other threads.


Diffs
-----

  src/slave/container_loggers/lib_logrotate.cpp bfc7cade2eed98f21fc1c364c104ad5583648c63 

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


Testing
-------

Manual testing:

```
  ./mesos-master.sh --work_dir=/tmp/master --ip=127.0.0.1
  ./mesos-slave.sh --master=127.0.0.1:5050 --modules=file:///path/to/modules.json --container_logger="org_apache_mesos_LogrotateContainerLogger"
--work_dir=/tmp/agent
  ./mesos-execute --master=127.0.0.1:5050 --name="Snore" --command="while true; do echo 'ZZZzzz...';
sleep 0.4; done" &
  ./mesos-execute --master=127.0.0.1:5050 --name="Snorelax" --command="while true; do echo
'SNORE'; sleep 1; done" &
  ./mesos-execute --master=127.0.0.1:5050 --name="Sleepy" --command="while true; do echo 'Yawn
:D'; sleep 0.6; done" &
  ./mesos-execute --master=127.0.0.1:5050 --name="Tired" --command="while true; do echo 'Blegh
X_X'; sleep 0.5; done" &
  ./mesos-execute --master=127.0.0.1:5050 --name="Sleep Zombie" --command="while true; do
echo 'Pillowz...'; sleep 1.2; done" &
  ./mesos-execute --master=127.0.0.1:5050 --name="ZZZ" --command="while true; do echo '...';
sleep 0.8; done" &
  
  # Trigger a bunch of executor terminations.  The agent may fail an assert when it re-closes
a socket.
  killall mesos-execute
```

"modules.json" follows the template:
```
{
  "libraries": [
    {
      "file": "/path/to/liblogrotate_container_logger.la",
      "modules": [
        {
          "name": "org_apache_mesos_LogrotateContainerLogger",
          "parameters": [
            {
              "key": "launcher_dir",
              "value": "/path/to/mesos/build/src/"
            }, {
              "key": "logrotate_stdout_options",
              "value": "rotate 2"
            }, {
              "key": "logrotate_stderr_options",
              "value": "rotate 2"
            }
          ]
        }
      ]
    }
  ]
}
```


Thanks,

Joseph Wu


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message