0685276764
Use correct functions in maxutils CMake files
...
The headers and the static library were installed unconditionally.
2018-08-20 13:56:58 +03:00
40a5ae81c7
MXS-2008 Store worker as MXB_WORKER* and not void*
2018-08-20 11:15:14 +03:00
e0cb11151f
MXS-2008 Move maxscale/worker.h to maxbase/worker.h
2018-08-20 11:15:14 +03:00
932956d5f6
MXS-2008 Add maxbase/poll.[h|hh]
...
Remove maxscale/poll_core.h
2018-08-20 11:15:14 +03:00
8f257a51fe
MXS-2008 Remove unused headers from worker.hh
...
Add corresponding headers to files that depended on those headers.
2018-08-20 11:15:14 +03:00
aaad63ee5e
MXS-2008 Move content of maxscale/platform.h to maxbase/cdefs.h
...
No good reason for keeping that platform adjustments anywhere
else but in cdefs.h.
2018-08-20 11:15:14 +03:00
90960ec07f
Make Worker::run(mxb::Semaphore*) private
...
The semaphore is only used when Worker::start() is called to synchronize
the startup of the two threads. Also asserted that the state is what we
expected it to be.
2018-08-20 10:10:23 +03:00
af70dc3973
Fix build failures
...
Fixed build failures caused by merges and rebases.
2018-08-17 18:23:04 +03:00
667e9df97c
Merge branch '2.2' into develop
2018-08-17 18:10:44 +03:00
208949f1cb
Synchronize the worker thread with the starting thread
...
This guarantees that the caller of the start function will know whether
the worker is running by looking at its state.
This will prevent multiple successive stop calls to a worker which
happened when the monitors were altered via the REST API.
2018-08-17 18:09:51 +03:00
9510a3ae1a
Use normal asserts in log.cc
...
The logger can't use the asserts that log messages as it introduces a
cyclical dependency on the logger itself.
2018-08-17 18:09:51 +03:00
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
9b199cfb50
Remove duplicate CMakeLists.txt entry
...
maxutils/maxbase/src/test/CMakeLists.txt
2018-08-17 16:21:58 +03:00
b82822a4b0
MXS-2017 Move maxscale::Semaphore to maxbase::Semaphore
2018-08-17 15:57:44 +03:00
d8255d0cac
MXS-2017 Move maxscale::Semaphore to maxbase::Semaphore
2018-08-17 15:53:54 +03:00
25c81b118d
Rename conflicting test
2018-08-17 15:02:03 +03:00
81853d8d6b
Fix binlogrouter unit test
...
The test called mxs_log_finish multiple times.
2018-08-17 14:29:28 +03:00
f09afa2967
Combine regression test suite and main CMake projects
...
Combining the projects makes it easier to use common components. This
fixes the build failure of maxutils due to missing jansson definitions.
2018-08-17 14:29:28 +03:00
c7a6d75ab9
MXS-2014 Address review issues
2018-08-17 10:59:37 +03:00
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
894d4eb034
MXS-2014 Explicitly set the MaxScale log identification
2018-08-17 10:59:37 +03:00
15bf481120
MXS-2014 Allow the header and footer to be adjusted
2018-08-17 10:59:37 +03:00
4388b8517e
MXS-2014 Use standard assert in Logger
2018-08-17 10:59:37 +03:00
cfdfff46ae
MXS-2014 Add skeleton test for mxb::Log
2018-08-17 10:59:37 +03:00
12e8f28907
MXS-2014 Add mxb::Log class for convenience
...
In tests, the log can now be setup as
int main()
{
mxb::Log log;
...
}
That will initialize the log so that it logs to a file called
<program-name>.log in the current directory and finalize it
when the program exits.
2018-08-17 10:59:37 +03:00
be986d366a
MXS-2014 Handle default OOM message properly
2018-08-17 10:59:37 +03:00
57706e7758
Hide the MonitorInstance m_state field
...
The field had the same purpose as MXS_MONITOR->state. Now the field
is only used for checking if the MonitorInstance thread is running.
2018-08-17 09:47:32 +03:00
fe5df6d379
Remove duplicate monitor state definitions
...
The state is still stored in two different variables. Also, removed the
ALLOC and FREED states.
2018-08-17 09:47:32 +03:00
876cf7c86f
MXS-2014 Temporarily fix broken token pasting
2018-08-16 11:24:01 +03:00
19684deb69
MXS-2014 Init and finish properly
...
If any part of initalization fails, no resources are held.
At finalization, release all resources.
Also re-implement recent changes made to log_manager.cc that
did not automatically move over to log.cc.
2018-08-16 11:09:30 +03:00
a586aa13c4
MXS-2014 Add proper OOM support
...
Not that I think it ever will be needed...
2018-08-16 09:59:43 +03:00
85b68c439a
MXS-2014 Still more cleanup of maxbase/log.h
2018-08-16 09:59:43 +03:00
9a8bb95be6
MXS-2014 Rename mxs_log_priority_is_enabled
...
- Renamed to mxs_log_is_priority_enabled
- That function instead of the macro is now consistently used
2018-08-16 09:59:43 +03:00
8ae2997c4e
MXS-2014 Remove separate log_write() function
2018-08-16 09:59:43 +03:00
5b46d815e4
MXS-2014 Move message status checking into MessageRegistry
2018-08-16 09:59:43 +03:00
79b292dc39
MXS-2014 Additional cleanup of log.cc
2018-08-16 09:59:43 +03:00
5b70c7605c
MXS-2014 Some cleanup of log.cc
...
Unused stuff removed and unit variables collected into this_unit
structure.
2018-08-16 09:59:43 +03:00
0c479b5d13
MXS-2014 Enable asserts in log.cc
2018-08-16 09:59:43 +03:00
6b6bbceb6e
MXS-2014 Add maxbase/assert.h
...
Basically a copy of maxscale/debug.h, but with some name changes.
- ss_dassert -> mxb_assert
- ss_info_dassert -> mxb_assert_message
- ss_debug -> MXB_AT_DEBUG
2018-08-16 09:59:43 +03:00
952ee0c15f
MXS-2014 Implement MaxScale log manager using maxbase/log.h
2018-08-16 09:59:43 +03:00
52e6e10e28
MXS-2014 Remove duplicate function
...
Two functions that essentially did the same thing, but had
slightly different name.
2018-08-16 09:58:00 +03:00
b4912a942f
MXS-2014 Add missing MXB_[BEGIN|END]_DECLS
2018-08-16 09:58:00 +03:00
a191ed85a2
MXS-2014 Expose everything needed by the MaxScale log manager
2018-08-16 09:58:00 +03:00
1a6eb8165a
MXS-2014 Add log.[h|cc] to maxbase
...
Almost a verbatim copy of log_manager.[h|cc] with mxs changed
to mxb. The changes allow the MaxScale log manager to be moved
on top of this implementation.
2018-08-16 09:58:00 +03:00
17418572f9
MXS-2014 Move maxscale/jansson.h to maxbase/jansson.h
2018-08-16 09:58:00 +03:00
f98cb0fe8d
MXS-2014 Introduce possibility for providing log context
...
The current implementation of mxs_log_message() is otherwise
generic, but for the fact that the session id is automatically
injected into the message.
With this change, a mxs_log_init2() is introduced that in addition
to the existing parameters takes a function using which the context
can be provided. The implementation of mxs_log_init() now simply
calls mxs_log_init2() giving a function that provides the MaxScale
context.
This is in preparation for moving maxscale/log_manager.h to
maxbase/log.h.
2018-08-16 09:58:00 +03:00
3e0086cd09
Increase max config line length
...
This makes the theoretical upper server limit 16383 servers with each
having a 1023 character name.
2018-08-16 09:21:06 +03:00
f82c965bfb
Calculate timestamp lengths only once
...
The lengths will never change.
2018-08-16 09:21:06 +03:00
6aff79e634
Revert log manager message limit changes
...
There was no need to change the length of the buffer.
2018-08-16 09:21:06 +03:00
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