Skip to content

Rework server log handling #415

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 4, 2025
Merged

Conversation

locker
Copy link
Member

@locker locker commented Apr 2, 2025

Instead of configuring Tarantool test servers to write logs both to stdout and a file using the tee command, let's write all logs to stderr only and make the output beautifier work as tee. This fixes two issues at once:

  • Using grep_log() for a server started using the cluster helper.
  • Using grep_log() for a stopped server.

Note that after this change we don't store all stderr output in the output beautifier anymore. It was used for detecting crashes at exit. Now, we use grep_log() to search for segmeration faults and memory leaks.

Closes #389
Closes #397

@locker locker force-pushed the server-log-rework branch from b73db1f to 7536175 Compare April 2, 2025 15:51
Compatibility with CMake < 3.5 has been removed from CMake.
@locker locker force-pushed the server-log-rework branch from 7536175 to 701063e Compare April 2, 2025 15:55
Otherwise we can get mixed logs in the unified log file after running
luatest a few times.

No changelog because the feature was added by commit f8a1c10
("Add logging to unified file"), which hasn't been released yet.
@locker locker force-pushed the server-log-rework branch from 701063e to 975dac0 Compare April 2, 2025 15:56
@locker locker changed the title Logger fixes Rework server log handling Apr 2, 2025
Instead of configuring Tarantool test servers to write logs both to
stdout and a file using the tee command, let's write all logs to stderr
only and make the output beautifier work as tee. This fixes two issues
at once:
 - Using `grep_log()` for a server started using the `cluster` helper.
 - Using `grep_log()` for a stopped server.

Note that after this change we don't store all stderr output in
the output beautifier anymore. It was used for detecting crashes
at exit. Now, we use `grep_log()` to search for segmeration faults
and memory leaks.

Closes tarantool#389
Closes tarantool#397
If unified logging is enabled, logs written by the runner are written
both to its own log file and to the unified log file. This is consistent
with how logs written by test processes are handled. However, if unified
logging is disabled, then runner logs are written only to its log file
while test process logs are also written to stdout and captured if
capturing is enabled. Let's write runner logs to stdout in this case as
well because they can be useful for debugging.

While we are at it, let's get rid of using `tee` for logging: we can
redirect all logs to the output beautifier directly and instruct the
latter to write them to a file.

No changelog because the feature was added by commit f8a1c10
("Add logging to unified file"), which hasn't been released yet.
@locker locker force-pushed the server-log-rework branch from 1a77a5e to c1d5324 Compare April 3, 2025 13:34
Copy link
Member

@Totktonada Totktonada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I like the idea.

On a brief glance I see no flaws. LGTM.

@Totktonada Totktonada removed their assignment Apr 4, 2025
@locker locker merged commit 6c5c8b7 into tarantool:master Apr 4, 2025
9 checks passed
@locker locker deleted the server-log-rework branch April 4, 2025 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Server:grep_log() doesn't work with stopped server Server:grep_log() doesn't work with config_file
2 participants