Commit Graph

22 Commits

Author SHA1 Message Date
Nick Ethier b0ddc03409
Merge pull request #4765 from jippi/increase-line-scan-limit
fix: increase log rotator line scan limit
2018-10-29 18:46:30 -07:00
Nick Ethier 5dee1141d1 executor v2 (#4656)
* client/executor: refactor client to remove interpolation

* executor: POC libcontainer based executor

* vendor: use hashicorp libcontainer fork

* vendor: add libcontainer/nsenter dep

* executor: updated executor interface to simplify operations

* executor: implement logging pipe

* logmon: new logmon plugin to manage task logs

* driver/executor: use logmon for log management

* executor: fix tests and windows build

* executor: fix logging key names

* executor: fix test failures

* executor: add config field to toggle between using libcontainer and standard executors

* logmon: use discover utility to discover nomad executable

* executor: only call libcontainer-shim on main in linux

* logmon: use seperate path configs for stdout/stderr fifos

* executor: windows fixes

* executor: created reusable pid stats collection utility that can be used in an executor

* executor: update fifo.Open calls

* executor: fix build

* remove executor from docker driver

* executor: Shutdown func to kill and cleanup executor and its children

* executor: move linux specific universal executor funcs to seperate file

* move logmon initialization to a task runner hook

* client: doc fixes and renaming from code review


* taskrunner: use shared config struct for logmon fifo fields

* taskrunner: logmon only needs to be started once per task
2018-10-16 16:53:31 -07:00
Christian Winther 0c5154100c
fix: increase log rotator line scan limit
In case where gelf/json logging is used, its fairly easy to exceed the 16k limit, resulting in json output being cut up into multiple strings

the result is invalid json lines which can create all kind of badness in the logging server

This fixes https://github.com/hashicorp/nomad/issues/4699

Signed-off-by: Christian Winther <jippignu@gmail.com>
2018-10-09 18:57:18 +02:00
Alex Dadgar 3671ed139d Avoid splitting log line across two files
We attempt to avoid splitting a log line between two files by detecting
if we are near the file size limit and scanning for new lines and only
flushing those.

BenchmarkRotator/1KB-8            300000              5613 ns/op
BenchmarkRotator/2KB-8            200000              8384 ns/op
BenchmarkRotator/4KB-8            100000             14604 ns/op
BenchmarkRotator/8KB-8             50000             25002 ns/op
BenchmarkRotator/16KB-8            30000             47572 ns/op
BenchmarkRotator/32KB-8            20000             92080 ns/op
BenchmarkRotator/64KB-8            10000            165883 ns/op
BenchmarkRotator/128KB-8            5000            294405 ns/op
BenchmarkRotator/256KB-8            2000            572374 ns/op
2018-05-10 15:11:01 -07:00
Alex Dadgar f5d91b5338 Benchmark for rotator
BenchmarkRotator/1KB-8            200000              5572 ns/op
BenchmarkRotator/2KB-8            200000              8338 ns/op
BenchmarkRotator/4KB-8            100000             14246 ns/op
BenchmarkRotator/8KB-8             50000             25279 ns/op
BenchmarkRotator/16KB-8            30000             48602 ns/op
BenchmarkRotator/32KB-8            20000             92159 ns/op
BenchmarkRotator/64KB-8            10000            154766 ns/op
BenchmarkRotator/128KB-8            5000            296872 ns/op
BenchmarkRotator/256KB-8            3000            551793 ns/op
2018-05-10 14:15:15 -07:00
Alex Dadgar e067a9ae06 naming of constants 2018-05-09 16:46:52 -07:00
Alex Dadgar 4173834231 Enable more linters 2017-09-26 15:26:33 -07:00
Ian Eyberg 3fbc58997b dont throw away errors in log rotation 2017-05-25 11:49:33 -07:00
Alex Dadgar ebdc873e47 protect writing to closed channel 2016-04-18 11:46:57 -07:00
Diptanu Choudhury 47e2c6bbfc Fixing race issues in the log rotator 2016-04-06 18:58:34 -07:00
Diptanu Choudhury f552159a34 Logging errors in the file rotator 2016-04-06 12:06:49 -07:00
Diptanu Choudhury 425258bd46 Fixing comments 2016-03-29 17:30:43 -07:00
Diptanu Choudhury b55254ba0a Not deleting files if the number of files is less than max files 2016-03-29 16:42:18 -07:00
Diptanu Choudhury 034d2f6470 Making the calls to exit idempotent 2016-03-22 11:49:56 -07:00
Diptanu Choudhury fd2be356cc Closing the messages channel 2016-02-23 10:14:54 -08:00
Diptanu Choudhury bd99982b96 Stoping go-routines in the syslog collector 2016-02-23 09:43:14 -08:00
Diptanu Choudhury c9e00127c3 Buffering writes to a rotated file 2016-02-23 08:52:06 -08:00
Diptanu Choudhury 91e8800b6b Added more comments 2016-02-19 21:58:44 -08:00
Diptanu Choudhury 0cc9b76d26 Fixed tests 2016-02-19 15:15:59 -08:00
Diptanu Choudhury 8096722cad Added some docs to the FileRotator 2016-02-19 14:11:31 -08:00
Diptanu Choudhury 4873118cef Making the log rotator a writer 2016-02-19 14:01:07 -08:00
Diptanu Choudhury 824df263aa Implemented file rotator 2016-02-19 12:55:34 -08:00