Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Watchdog launches tarantool in a way that produce log to stderr and thus tarantool itself does nothing to handle log rotation, it is handled entirely at watchdog side.
Prior to this patch
os.File
was used inCmd.Stdout
, when watchdog launches tarantool binary and according to golang documentation (seeExec.Cmd.Stdout
) in this special case output from the child process is connected directly to that file. It means that even if it is closed at watchdog side, its child process (tarantool) keeps using the original one, i.e. it proceeds with logging to the original file even after renaming it.Now
Logger
is used asCmd.Stdout
, and according to the mentioned documentation separate goroutine reads output from the child process over a pipe and delivers that data to theLogger
. It allows proper handling of log rotation at watchdog side.@TarantoolBot document
Title:
tt logrotate
properly release descriptor of the old log file.I didn't forget about:
Related issues:
Closes #1174