The cause of im_daemon_life_cycle.imtest random failures was the following
behaviour of some implementations of LINUX threads: let's suppose that a
process has several threads (in LINUX threads, there is a separate process for
each thread). When the main process gets killed, the parent receives SIGCHLD
before all threads (child processes) die. In other words, the parent receives
SIGCHLD, when its child is not completely dead.
In terms of IM, that means that IM-angel receives SIGCHLD when IM-main is not dead
and still holds some resources. After receiving SIGCHLD, IM-angel restarts
IM-main, but IM-main failed to initialize, because previous instance (copy) of
IM-main still holds server socket (TCP-port).
Another problem here was that IM-angel restarted IM-main only if it was killed
by signal. If it exited with error, IM-angel thought it's intended / graceful
shutdown and exited itself.
So, when the second instance of IM-main failed to initialize, IM-angel thought
it's intended shutdown and quit.
The fix is
1. to change IM-angel so that it restarts IM-main if it exited with error code;
2. to change IM-main so that it returns proper exit code in case of failure.
Corrected spelling in copyright text
Makefile.am:
Don't update the files from BitKeeper
Many files:
Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
Adjusted year(s) in copyright header
Many files:
Added GPL copyright text
Removed files:
Docs/Support/colspec-fix.pl
Docs/Support/docbook-fixup.pl
Docs/Support/docbook-prefix.pl
Docs/Support/docbook-split
Docs/Support/make-docbook
Docs/Support/make-makefile
Docs/Support/test-make-manual
Docs/Support/test-make-manual-de
Docs/Support/xwf
- Use same precision (milliseconds) for all time functions
used when calculating time for pthread_cond_timedwait
- Use 'GetSystemTimeAsFileTime' for both start and curr time
On windows IM aborted on assert once one
stoppped it. The reason is that we didn't
close the sockets on windows and therefore,
the listener thread wasn't able to finish.
This happened because we used close() call
for it. While on windows one should use
closesocket().
On other platfroms we have appropriate defines
for closesocket(), so this is the function which
should be used.
(Mostly in DBUG_PRINT() and unused arguments)
Fixed bug in query cache when used with traceing (--with-debug)
Fixed memory leak in mysqldump
Removed warnings from mysqltest scripts (replaced -- with #)
Remove race situations that occur when removing pidfiles. Primarily each process should remove its own
pidfile, secondly it should be removed by the process that created it and _only_ if it's
certain the process is dead. Third, mysql-test-run.pl will remove the pidfile when process has been killed.
- Set state of an instance to STARTING _before_ calling instance->start()
- Check that pidfile of instance has been created before changing STARTING => STARTED
- Only remove the pidfile if IM kills an instance with SIGKILL, otherwise the instance will remove it itself
start instance; kill mysqlmanager; show ...
The problem was that Instance Manager didn't close client
sockets (sockets for client connections) on execing mysqld
instance. So, mysqld-instance inherits these descriptors.
The fix is to set close-on-exec flag for each client socket.
Place mysqlmanager 'pdb' file in 'client_debug' directory
mysys.vcproj:
Removed define of __NT__ from 'Debug' target
mysqld.vcproj:
Always generate 'pdb' and 'map' files
Disable old RPM strip
my_global.h:
Fixed wrong cast, which caused problems with gcc 4.0 and
floats in prepared statements (Bug #19694)
mysqlmanager.vcproj:
Place output files in common release/debug directory
The problem was a call to convert_dirname() with a destination buffer
that did not have room for the trailing slash added by that function.
This could cause the instance manager to crash in some cases.
- Include prefix files that renames all public functions in yaSSLs
OpenSSL API to ya<function_name>. They will otherwise conflict
with OpenSSL functions if loaded by an application that uses OpenSSL
as well as libmysqlclient with yaSSL support.
tests fail on FreeBSD.
The patch contains of the following:
- make Instance Manager, running in the daemon mode, dump
the pid of angel-process in the special file;
- default value of angel-pid-file-name is 'mysqlmanager.angel.pid';
- if ordinary (IM) pid-file-name is specified in the configuration,
angel-pid-file-name is updated according to the following
rule: extension of the basename of pid-file-name is replaced by
'.angel.pid.
For example:
- pid-file-name: /tmp/im.pid
=> angel-pid-file-name: /tmp/im.angel.pid
- pid-file-name: /tmp/im.txt
=> angel-pid-file-name: /tmp/im.angel.pid
- pid-file-name: /tmp/5.0/im
=> angel-pid-file-name: /tmp/5.0/im.angel.pid
- add support for configuration option to customize angel
pid file name;
- fix test suite to use angel pid to kill Instance Manager
by all means if something went wrong.
Background
----------
The problem is that on some OSes (FreeBSD for one) Instance
Manager does not get SIGTERM, so can not shutdown gracefully.
Test suite wasn't able to cope with it, so this leads to the
mess in test results.
The problem should be split into two:
- fix signal handling;
- fix test suite.
This patch fixes test suite so that it will be able to kill
uncooperative Instance Manager. In order to achieve this,
test suite needs to know PID of IM Angel process.
- Add function "mysqld_real_path" which is needed if the mysqld_path is a symlink or a script(like libtool) that executes the real mysqld.
- Add new variable mysqld_real_path
- Use mysqld_real_path from fill_instance_version
duration of the whole 'flush instances'. As a consequence,
it was possible to query instance map, while it is in the
inconsistent state. The patch was reworked after review.