In preparation to deglobalizing CephContext, remove the CephContext*
parameter to ceph_clock_now() and ceph::real_clock::now() that carries
a configurable offset.
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
LOG_DEBUG prio messages are not logged by a default syslog
configuration so log at LOG_INFO instead.
Fixes: #15808
Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
we have two copies of Graylog.* in src/common and src/log, and turns out
the ones in src/common are what we are using. so remove the other two.
Signed-off-by: Kefu Chai <kchai@redhat.com>
>>> CID 1355574: Error handling issues (NEGATIVE_RETURNS)
>>> "this->m_fd" is passed to a parameter that cannot be negative.
Signed-off-by: Sage Weil <sage@redhat.com>
If we get an error writing to the log, log it only once to stderr.
This avoids generating, say, 72 GB of ENOSPC errors in
teuthology.log when /var/log fills up.
Fixes: #14616
Signed-off-by: Sage Weil <sage@redhat.com>
this piece of code creates a SEGV from logging code to verify a
bug fix at e3fe18a.
clang will delete the null-referencing code. so we need to either
- pass -Wnonull-dereference to $(CC)
- or use __builtin_trap() offered by GCC/clang
- or use `volatile`
seems volatile is easier and probably more portable.
Fixes: #14856
Signed-off-by: Kefu Chai <kchai@redhat.com>
graylog uses boost/asio.hpp which introduces the link-time dependency on
libboost_system to the compilation units which includes Log.h and
LogClient.h. so it appears that perfglue/heap_profiler.cc is referencing
libboost_system.so, and fails the cmake build of all tests which links
against tcmalloc.
in this change, we:
* remove unnecessary #includes from Graylog.h
* forward declare Graylog class, so that "Graylog.h" is not included in
any header files to avoid the link-time dependency pollution
Signed-off-by: Kefu Chai <kchai@redhat.com>
Use explicit keyword for constructors with one argument to
prevent implicit usage as conversion functions.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Adds graylog/GELF logging support to clog and monitor log.
Changes to Graylog class:
- Support Logging LogEntry classes
- Add parameter "logger" to indicate the log source
(e.g dlog, clog, mon)
New config opts:
- clog to graylog
- clog to graylog host
- clog to graylog port
- mon cluster log to graylog
- mon cluster log to graylog host
- mon cluster log to graylog port
Signed-off-by: Marcel Lauhoff <ml@irq0.org>
Add graylog2 as logger target. Format log entries as GELF and send them via UDP to log server
New config options
- log_to_graylog
- err_to_graylog
- log_graylog_host
- log_graylog_port
[0] https://www.graylog2.org/resources/gelf
Signed-off-by: Marcel Lauhoff <ml@irq0.org>
Adding names to threads simplifies cpu usage realtime tracking
e.g. top -H -p <OSD_PID>
This commit changes Thread.create() method forcing to pass thread name.
Signed-off-by: Igor Podoski <igor.podoski@ts.fujitsu.com>
Initial allocation size is derived from last log message from the same line of code.
Fixed bug in test.
Signed-off-by: Adam Kupczyk <akupczyk@mirantis.com>
Otherwise, _flush() might continue to write to m_fd after it's closed.
This might cause log data to go to a data object if the filestore then
reuses the fd during that time.
Fixes: #12465
Backport: firefly, hammer
Signed-off-by: Samuel Just <sjust@redhat.com>
Test that the segv injection works.
Test that a segv while logging something doesn't hang when the signal
handlers are installed. Note that this fails/hangs without the previous
fix.
Signed-off-by: Sage Weil <sage@redhat.com>
Memory leaks detector report:
$ valgrind --leak-check=full /usr/bin/radosgw -c /etc/ceph/ceph.conf -n
client.radosgw.gateway -
...
==16986== 8 bytes in 1 blocks are definitely lost in loss record 14 of 83
==16986== at 0x4A075BC: operator new(unsigned long) (vg_replace_malloc.c:298)
==16986== by 0x58980B8: ceph::log::Log::set_flush_on_exit() (in /usr/lib64/librados.so.2.0.0)
==16986== by 0x6BE3CA: global_init(std::vector<char const*, std::allocator<char const*> >*, st
==16986== by 0x5B6B0A: main (in /usr/bin/radosgw)
...
Signed-off-by: Andrey Kuznetsov <Andrey_Kuznetsov@epam.com>
The version of TEMP_FAILURE_RETRY found on Linux has a GNU extension
that squashes the unused return value warning where applicable. This
adds a VOID_TEMP_FAILURE_RETRY to make the case explicit, casting the
expression value to void to avoid the warning.
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
- Enabling subdir objects
- Created a Makefile-env.am with basic automake init
- Created .am files per subdir, included from src/Makefile.am
Signed-off-by: Roald J. van Loon <roaldvanloon@gmail.com>
We weren't locking m_flush_mutex properly, which in turn was leading to
racing threads calling dump_recent() and garbling the crash dump output.
Backport: bobtail, argonaut
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
We were using a single cond, and only signalling one waiter. That means
that if the flusher and several logging threads are waiting, and we hit
a limit, we the logger could signal another logger instead of the flusher,
and we could deadlock.
Similarly, if the flusher empties the queue, it might signal only a single
logger, and that logger could re-signal the flusher, and the other logger
could wait forever.
Intead, break the single cond into two: one for loggers, and one for the
flusher. Always signal the (one) flusher, and always broadcast to all
loggers.
Backport: bobtail, argonaut
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>