190 Commits

Author SHA1 Message Date
Markus Mäkelä
b4108270dc
MXS-2982: Fix documetation link in --help output 2020-05-11 07:44:57 +03:00
Johan Wikman
f527a8f2e6 2.3.19 Update Change Date 2020-04-23 14:23:57 +03:00
Johan Wikman
e0cd6adb26 Update change date for 2.3.18 2020-03-10 10:45:47 +02:00
Johan Wikman
cfb3f79b54 Update 2.3.17 Change Date 2020-02-10 15:28:38 +02:00
Markus Mäkelä
4f1ae70765
Allow multiple fatal signals
As long as the same thread never handles more than one fatal signal,
multiple fatal signals can be processed. This should guarantee that the
stacktrace is printed into the log while guaranteeing that recursion never
takes place if the handling of a fatal signal causes a fatal signal to be
emitted.
2020-01-23 18:37:57 +02:00
Johan Wikman
790d90f229 Update 2.3.16 Change Date 2020-01-15 11:08:51 +02:00
Johan Wikman
df6c56e7ca Update 2.3.13 Change Date 2019-10-29 12:51:31 +02:00
Marko
918a2964d5 MXS-2592 Add configuration for session specific in-memory log
When enabled each session will write log messages in the in-memory log.
If session ends in error this log is written to the actual log in disk.
2019-07-28 20:56:22 +03:00
Markus Mäkelä
146b940245
Dump statements on fatal signal
This should make it easier to figure out what is going on at the time of
the crash if statement collection is enabled.
2019-07-19 12:03:36 +03:00
Markus Mäkelä
3d8475f8ed
Merge branch '2.2' into 2.3 2019-06-19 12:37:23 +03:00
Markus Mäkelä
27fb397041
MXS-2547: Do shutdown on main worker
By stopping the REST API before the workers and moving the shutdown to the
same worker that handles REST API requests, we prevent the hang on
shutdown. This also makes the signal handler signal-safe.
2019-06-19 10:31:47 +03:00
Markus Mäkelä
35d31801bb
Merge branch '2.2' into 2.3 2018-12-17 23:52:56 +02:00
Niclas Antti
f2a3a5737a MXS-2221 Fatal signal handling does not always create a core
Quick and simple fix, but this should be overhauled. See MXS-599.
2018-12-11 14:22:35 +02:00
Niclas Antti
1108132cbd MXS-2057 Do not require systemd libraries
Exclude systemd usage if the library is not installed.
Only excluding what is necessary. This keeps the object size the
same and still compiles most of the code.
2018-11-09 16:45:59 +02:00
Niclas Antti
f29e5b65de MXS-2057 systemd watchdog
Systemd wathdog notification at a little more than 2/3 of the
systemd configured time. In the service config (maxscale.service)
add e.g. WatchdogSec=30s to set and enable the watchdog.
For building: install libsystemd-dev.

The next commit will modify cmake configuration and code to
conditionally compile the new code based on existence of libsystemd-dev.
2018-11-09 16:45:59 +02:00
Markus Mäkelä
75f9921ca2
Merge branch '2.2' into develop 2018-10-02 10:18:09 +03:00
Markus Mäkelä
288fbc8c33
MXS-2075: Only enable stdout redirection for maxscale
The stdout redirection must not be enabled for the other programs as they
are not run as daemon processes.
2018-10-02 09:44:02 +03:00
Markus Mäkelä
62e5f988c5
MXS-2075: Redirect stdout and stderr to the log
If the log file is successfully opened, both stdout and stderr are
redirected to it. This helps catch ASAN reports without having to read the
system journal files.

As the output is redirected to a file, some of the output was made visible
only in non-daemon mode. This helps keep the log file clean and readable.
2018-10-02 09:44:02 +03:00
Markus Mäkelä
9278da1f54
MXS-2067: Remove spinlock.h
Removed the spinlock.h header and replaced with plain pthread types and
functions.
2018-09-28 12:18:24 +03:00
Markus Mäkelä
f17dfdbc2b
Fix filter destruction
The filter instances weren't cleared before the dynamically loaded
libraries were unloaded which caused a crash.
2018-09-24 12:08:04 +03:00
Markus Mäkelä
71ffef5708
Partially revert 4ba011266843857bbd3201e5b925a47e88e1808f
Add back leading operator enforcement.
2018-09-20 15:57:30 +03:00
Markus Mäkelä
58c0b4f5f4
MXS-1632: Remove the unused statistics code
The statistics code was almost completely unused.
2018-09-10 14:14:20 +03:00
Niclas Antti
c447e5cf15 Uncrustify maxscale
See script directory for method. The script to run in the top level
MaxScale directory is called maxscale-uncrustify.sh, which uses
another script, list-src, from the same directory (so you need to set
your PATH). The uncrustify version was 0.66.
2018-09-09 22:26:19 +03:00
Markus Mäkelä
26dfb19ea4
Make routingworker.hh public
Given that worker.hh was public, it made sense to make routingworker.hh
public as well. This removes the need to include private headers in
modules and allows C++ constructs to be used in C++ code when previously
only the C API was available.
2018-09-04 13:04:08 +03:00
Esa Korhonen
763e1395ae Print port with 'enable-statement-logging' 2018-09-03 11:08:33 +03:00
Johan Wikman
32c4e60516 Do not re-initialize the log
Do not re-initialize the log without it having been finished
in between.
2018-08-30 15:03:06 +03:00
Markus Mäkelä
d9ddf0f720
Reinstate implicit log initialization
As some of the functionality depends on the log being default initialized
in the case an error occurs, the code needed to be reinstated.
2018-08-29 11:06:12 +03:00
Markus Mäkelä
9adc08a686
Move log initialization into a function
This will be of help when the implicit log initialization is added back.
2018-08-29 11:06:11 +03:00
Markus Mäkelä
8b653133a7
Add shutdown detection
The maxscale_is_shutting_down function is used to detect when MaxScale
should stop. This fixes a race condition in the code where the workers has
not yet been initialized but a termination signal has been received. It
also replaces the misuse of the service_should_stop variable with a proper
function.
2018-08-29 11:06:11 +03:00
Markus Mäkelä
c92aa02961
Don't use log before initialization
The print_log_n_stderr function used to implicitly initialize the log
manager. As this is no longer done, no logging must be done before the log
manager is initialized.
2018-08-27 14:03:39 +03:00
Markus Mäkelä
fe7d7475a4
Improve PID file check
The executable name of the PID is now checked to be maxscale. This fixes
the problem where MaxScale would refuse to start if a stale PID file had a
PID of a process that's not a MaxScale process.
2018-08-23 15:46:46 +03:00
Markus Mäkelä
ad36a50e97
Remove log initialization form print_log_n_stderr
The log manager must not be initialized twice. If an error is to be logged
to a file, the log manager has already been initialized.
2018-08-23 15:46:46 +03:00
Marko
8e7b012852 Don't call some of atexit functions twice
Registering of atexit functions was fixed so these functions don't need
to be called here anymore.
2018-08-22 22:51:32 +03:00
Johan Wikman
3f53eddbde MXS-2020 Replace ss[_info]_dassert with mxb_assert[_message] 2018-08-22 11:34:59 +03:00
Johan Wikman
3576780f78 MXS-2008 Update gateway and tests to initialize maxbase
Update gateway and tests to initialize maxbase using

  maxbase::init();

instead of initializing individual components.
2018-08-21 10:02:39 +03:00
Johan Wikman
88f1795412 MXS-2008 Move Worker and MessageQueue to maxbase 2018-08-21 10:02:39 +03:00
Markus Mäkelä
fe7a73e5c3
Register atexit functions in the correct place
The atexit functions should be registered after there is a need for
them. This fixes the problem where cleanup functions were called before
the initialization for them was done. Also removed the header and footer
printint to stdout.
2018-08-20 13:56:59 +03:00
Markus Mäkelä
c38dcff53c
MXS-2019: Remove header and footer output
Now that the exit handlers work correctly, the output of `maxscale
--version` no longer consists of a single line but multiple lines in both
stdout and stderr. Removing the printing to stderr guarantees that the
correct output is produced.
2018-08-20 10:04:12 +03:00
Markus Mäkelä
667e9df97c
Merge branch '2.2' into develop 2018-08-17 18:10:44 +03:00
Markus Mäkelä
0fbd789572
MXS-2019: Fix atexit handlers
The code now registers all functions once instead of one function multiple
times.
2018-08-17 17:35:41 +03:00
Johan Wikman
cf0aeed516 MXS-2014 Rename log_manager.h to log.h
There's nothing resembling a manager anymore.
2018-08-17 10:59:37 +03:00
Marko
9370cda24b MXS-1663 Detect conflicting configurations and refuse to start
Use locks with the datadir and cachedir to detect if another MaxScale
instance attempts to use the same directories as the already running
MaxScale.
2018-08-15 22:23:32 +03:00
Markus Mäkelä
5a306aa20a
MXS-2005: Use log manager only after initialization
The log manager functions must not be used before it is initialized.
2018-08-14 14:57:34 +03:00
Markus Mäkelä
39ce6c624f
MXS-2005: Remove unused code
Removed skygw_utils and relate files along with the old log manager
code. Also removed file flushing due to it being redundant; messages are
written to the file immediately. Adjusted tests to accommodate this
change.
2018-08-14 14:57:33 +03:00
Markus Mäkelä
32b1711684
MXS-2005: Remove logging to shared memory
The feature was rarely used and was only useful in extremely rare
cases. The functionality can still be emulated, if for some reason needed,
by pointing `logdir` to `/dev/shm` or another tmpfs mount.
2018-08-14 14:57:33 +03:00
Markus Mäkelä
2852530893
Use standard RNG
The custom random number generator can now be replaced with a C++11
RNG. This greatly improves the reliability and trustworthiness of it.

In addition to this, the conversion of the RNG to a thread-local object
removes the race condition that was present in the previous
implementation. It also theoretically improves performance by a tiny bit.
2018-08-13 10:37:48 +03:00
Markus Mäkelä
70fa300fe1
Remove unnecessary mxs_log_flush_sync calls
The calls were unnecessary in the context where they were made.
2018-08-13 10:28:02 +03:00
Johan Wikman
2539183be2 MXS-2000 Add query_classifier_cache_size to maxscale resource 2018-08-09 08:37:44 +03:00
Markus Mäkelä
ec420332ea
MXS-1929: Take ResultSet into use
Replaced the previous RESULTSET with the new implementation. As the new
ResultSet doesn't have a JSON streaming capability, the MaxInfo JSON
interface has been removed. This should not be a big problem as the REST
API offers the same information in a more secure and structured way.
2018-07-31 22:50:08 +03:00
Markus Mäkelä
ad5762a2fb
Fix debug assertion on shutdown
The debug assertion that asserts that services are destroyed only on the
main worker would be triggered on shutdown as there is no current worker
at that point in time. In addition to this, it is wrong to call
service_destroy at shutdown as that will remove persisted
configurations. The service_free function can be called directly as we
know no other thread are running when the services are being torn down.

Also added the missing check that the destroyInstance function is
implemented before calling it.
2018-07-31 22:32:31 +03:00