maria:bb-10.3-midenok-MDEV-28931

Last commit made on 2022-07-18
Get this branch:
git clone -b bb-10.3-midenok-MDEV-28931 https://git.launchpad.net/maria

Branch merges

Branch information

Name:
bb-10.3-midenok-MDEV-28931
Repository:
lp:maria

Recent commits

f02ffe8... by midenok

Tmp

a0d56f6... by midenok

MDEV-29023 MTR hangs after multiple failures

Passing $opt_parallel as $childs is wrong: child can be killed before
it connects and you will never decrement $childs for this.

Another problem is (and that is the cause of this bug): child can be
killed and never close server socket. This can happen f.ex. after
unmaskable KILL signal. In such case the socket is closed by reaping
the child but that never happens inside reading the socket loop in
run_test_server().

The proper design is the waitless reap of children inside the socket
loop and if there is no more children we finish the socket loop. Since
there is Windows variation where we don't control the children via
waitpid(), all the clients must normally close the socket and only
this can finish the socket loop. For Unix variation we reckon that
case as all children closed the socket but not all yet died and for
that we do final waiting waitpid() (was done before the patch as
well).

To be more complete, we now handle 3 end-of-game scenarios in Unix:

   1. all children closed socket, all children died: everything is
      handled by the socket loop;

   2. all children closed socket, not all yet died: we wait for alive
      children to die after exiting the socket loop;

   3. not all children closed socket, all children died: everything is
      handled by the socket loop.

For Windows end-of-game scenario is only one:

   All children close the socket.

e01a3bd... by midenok

MDEV-29023 waitpid() cleanup

The case for "Unknown process $ret_pid exited" is never known to be
valid. Such state is not documented for waitpid().

5f3d0b8... by midenok

MDEV-29025 MTR doesn't print stack trace for bootstrap crashes

64b22ea... by midenok

MDEV-29025 Refactoring: moved out core_wanted() out of mysql-test-run.pl

29dc89b... by midenok

MDEV-28931 MTR prints detailed stack trace unconditionally

66832e3a introduced change that prints core dumps in very detailed
format. That's completely out of user-friendliness but serves as a
measure for debugging hard-reproducible bugs.

The proper way to implement this:

  1. it must be controlled by command-line and environment variable;
  2. detailed traces must be default for buildbots only, for user
     invocations normal stack traces should be printed.

Options for control are: MTR_PRINT_CORE and --print-core that accept
the following values:

  no Don't print core
  short Print stack trace of failed thread
  medium Print stack traces of all threads
  detailed Print all stack traces with debug context
  custom:<code> Use debugger commands <code> to print stack trace

Default setting is: short (see env_or_default() call in pre_setup())

For environment variable wrong values are silently ignored (falls back
to default setting, see env_or_default()).

Command-line option --print-core (or -C) overrides environment
variable. Its default value is 'short' if not specified explicitly
(same env_or_default() call in pre_setup()). Explicit values are
checked for validity.

--print-method option can specify by which debugger we print
cores. For Windows there is only one choice: cdb. For Unix the values
are: gdb, dbx, lldb, auto. Default value is: auto

In 'auto' we try to use all possible debuggers until success.

1cec3bc... by midenok

MDEV-28931 Debugger.pm readability fix

setup_boot_args(), setup_client_args(), setup_args() traversing
datastructures on each invocation. Even if performance is not
important to perl script (though it definitely saves some CO2), this
nonetheless provokes some code-reading questions. Reading and
debugging such code is not convenient.

The better way is to prepare all the data in advance in an easily
readable form as well as do the validation step before any further
processing.

Use mtr_report() instead of die() like the other code does.

TODO: do_args() does even more data processing magic. Prepare that
data according the above strategy in advance in pre_setup() if possible.

794c0a5... by midenok

MDEV-28931 --verbose option is too verbose

GetOpt::Long bundling option for convenient one-char verbosity levels:

  -v General verbosity (file and execute operations)
  -vv High verbosity (algorithmic considerations)
  -vvv Debug verbosity (anything else)

db45c31... by midenok

MDEV-28931 Cleanup: try GDB to print core first

Do we still need this Sun Studio hack?

953c532... by Sergei Golubchik

my_safe_process: try to kill the process softly first

first SIGTERM and if the process didn't die in 10 seconds, SIGKILL it.

This allows various tools like `rr`, `gcov`, `gprof`, etc to flush
their data to disk properly