Commit 9f8fc983 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-30242 MTR fails to report stack traces of all threads by default

An unfortunate change to the default behavior of the handling of
core dumps was implemented in
commit e9be5428
by making MTR_PRINT_CORE=small the default value, that is, to
only display the stack trace of one thread in crash reports.
Many if not most failures that occur in regression tests are
sporadic and involve race conditions or deadlocks. To be able to
analyze such failures, having the stack traces of all active threads
is a must, because CI environments typically do not save any core dumps.

While the environment variable MTR_PRINT_CORE could be set in CI
environments to compensate for the unfortunate change, it is better
to revert to the old default (dumping all threads) so that
no explicit action will be required from maintainers of independent
CI systems. In that case, if something fails once in a blue moon,
we can have some hope of diagnosing it based on the output.

We fix this regression by defaulting the unset environment variable
MTR_PRINT_CORE to "medium".
parent d0f6d467
......@@ -108,7 +108,7 @@ for my $f (keys %print_formats)
register_opt('print-core|C', ':s',
"Print core dump format: ". $print_formats. " (for not printing cores). ".
"Defaults to value of MTR_PRINT_CORE or 'short'");
"Defaults to value of MTR_PRINT_CORE or 'medium'");
if (!IS_WINDOWS)
{
register_opt('print-method', '=s',
......@@ -134,7 +134,7 @@ sub env_or_default($$) {
}
sub pre_setup() {
$config{print_core}= env_or_default('short', 'MTR_PRINT_CORE')
$config{print_core}= env_or_default('medium', 'MTR_PRINT_CORE')
if not defined $config{print_core};
$config{print_method}= (IS_WINDOWS) ? 'cdb' : 'auto'
if not defined $config{print_method};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment