1832 Commits

Author SHA1 Message Date
Alexander A. Klimov
bf0c68757f Don't require OS headers to provide SO_REUSEPORT 2019-02-26 11:25:44 +01:00
Michael Friedrich
458f997a18 Replace Copyright header with a short version, part II 2019-02-25 15:09:36 +01:00
Michael Friedrich
d14a88235d Replace Copyright header with a short version, part I
CLion -> replace in path
2019-02-25 14:48:22 +01:00
Michael Friedrich
ab7a799369 Implement ReloadTimeout constant and wait for enqueued checks on Stop() 2019-02-25 09:03:47 +01:00
Alexander A. Klimov
9558ebc0f4 Secure ApiUser::GetByAuthHeader() against timing attacks 2019-02-22 16:59:36 +01:00
Michael Friedrich
89634c2eb6 Re-add Defer functionality 2019-02-22 15:27:34 +01:00
Michael Friedrich
a25e2b1038 Stop object in reversed activation priority order
This stops the checker component first, then notifications, then
features, then config objects, then the API feature and logger(s).

Patch taken from @al2klimov
2019-02-20 12:38:57 +01:00
Michael Friedrich
5da1cbd096 Revert "Respect activation priority also on deactivation"
This reverts commit 8ad1717055683c573f81181c7749ba422fa96d13.
2019-02-19 14:30:44 +01:00
Michael Friedrich
a2f5b7a02c Revert "CheckerComponent#Stop(): wait for all running checks"
This reverts commit 1eaad0637b75bd24875b1e62fd080fb155b08ed7.
2019-02-19 14:05:00 +01:00
Michael Friedrich
d98c0704c4 Debug: Log calls to ConfigObject::Deactivate()
Only available in debug builds.
2019-02-19 13:49:52 +01:00
Michael Friedrich
0467c488e9
Merge pull request #6908 from Icinga/bugfix/perfdata-gaps
Ensure all perfdata to be written
2019-02-11 17:27:44 +01:00
Michael Friedrich
7a865aefd9
Merge pull request #6854 from Icinga/bugfix/unamehelper-inefficient-6452
Make UnameHelper() efficient
2019-02-11 16:57:17 +01:00
Alexander A. Klimov
8ad1717055 Respect activation priority also on deactivation 2019-02-06 11:17:45 +01:00
Michael Friedrich
4339240b46
Merge pull request #6858 from Icinga/feature/string-builder
Make string builder reusable
2019-02-04 16:05:20 +01:00
Michael Friedrich
77572c4424
Merge pull request #6901 from Icinga/bugfix/so_reuseport-6898
TcpSocket#Bind(): also set SO_REUSEPORT
2019-02-04 14:21:20 +01:00
Michael Friedrich
b58cb17e4b Fix Convert::ToLong(double val) 2019-01-30 14:47:59 +01:00
Alexander A. Klimov
1eaad0637b CheckerComponent#Stop(): wait for all running checks 2019-01-24 15:09:39 +01:00
Alexander A. Klimov
984f7be030 TcpSocket#Bind(): also set SO_REUSEPORT
refs #6898
2019-01-17 12:13:44 +01:00
Alexander A. Klimov
61860563a6 Make string builder reusable 2018-12-21 12:43:04 +01:00
Alexander A. Klimov
17e86f98a2 Make UnameHelper() efficient
refs #6452
2018-12-20 16:37:04 +01:00
Michael Friedrich
bf4ecbed69 Revert "ThreadPool#Stop(): discard non-processed queue items"
This reverts commit 30e6d0f809c47de4204b949263fa209da42e975c.

refs #6815
2018-12-06 09:56:49 +01:00
Michael Friedrich
08c1539561
Merge pull request #6815 from Icinga/bugfix/reload-while-api-dos
ThreadPool#Stop(): discard non-processed queue items
2018-12-05 11:11:49 +01:00
Alexander A. Klimov
30e6d0f809 ThreadPool#Stop(): discard non-processed queue items 2018-12-03 16:38:52 +01:00
Michael Friedrich
f3cd3eb870 DSL: Implement getenv()
This patch also restores Utility::GetFromEnvironment()
and replaces the hardcoded `getenv()` calls.
2018-11-19 18:11:16 +01:00
Michael Friedrich
90de216cbb
Merge pull request #6479 from Icinga/feature/socketevents-inherit-object-6477
SocketEvents: inherit from Stream
2018-11-12 17:06:37 +01:00
Michael Friedrich
1f5555e1d6 Fix possible double free in StreamLogger::BindStream()
refs #6737
2018-11-08 15:51:58 +01:00
Alexander A. Klimov
a2ae01e64b Socket engine: drop life support objects
refs #6477
2018-10-30 13:46:20 +01:00
Alexander A. Klimov
5134ccaf56 Make SocketEventDescriptor#EventInterface a SocketEvents::Ptr
refs #6477
2018-10-30 13:46:20 +01:00
Alexander A. Klimov
a9a9469868 SocketEvents: inherit from Stream
refs #6477
2018-10-30 13:46:20 +01:00
Michael Friedrich
5406ce6540 Ensure that API/JSON-RPC messages in the same session are processed and not stalled
This basically drops the "corked" implementation which just stalled the
TLS IO polling after some requests. If you need sort of rate limiting
for these events, use an external TLS proxy which terminates that in front
of Icinga.

fixes #6635
2018-10-29 12:57:24 +01:00
Michael Friedrich
7e1942e8e7
Merge pull request #6718 from Icinga/bugfix/ssl-shutdown
Call SSL_shutdown() at least twice
2018-10-24 11:46:32 +02:00
Michael Friedrich
dea5ec614e icinga.com: Update CMakeLists.txt 2018-10-18 09:35:18 +02:00
Michael Friedrich
44c3b83769 icinga.com: Update '*.ti' 2018-10-18 09:30:00 +02:00
Michael Friedrich
dab53448bc icinga.com: Update *.{h,c}pp 2018-10-18 09:27:04 +02:00
Michael Friedrich
af6c8a1f50 Add missing shutdown/program state dumps for SIGUSR2 reload handler
Credits to @west0rmann finding the issue and providing the initial fix.

fixes #6689
fixes #6592
2018-10-16 12:36:43 +02:00
Michael Friedrich
43a571e013 Don't throw an error when namespace indexers don't find a valid key
Examples:

```
globals["abc"]
globals.def
```

The patch for the Icinga Director unfortunately only solves the
master, and as discussed with @lippserd we need to ensure that
satellites and clients with 2.10 can be restarted without any errors
from deployed configuration.

refs #6509
refs icinga/icingaweb2-module-director#1654
2018-10-11 12:42:56 +02:00
Michael Friedrich
4be9f418a9 Revert "Initialize Socket Event Engine on application startup"
This reverts commit c8dcd1297f6d0be8685c5a3079e40fc44e779add.

We cannot do this during application startup, since Daemonize()
kills the threads again.

refs #6514
refs #6630
2018-10-09 19:38:29 +02:00
Michael Friedrich
96c0de9bea Allow to override MaxConcurrentChecks constant 2018-09-27 20:23:00 +02:00
Michael Friedrich
c8dcd1297f Initialize Socket Event Engine on application startup
Previously this happened inside the TlsStream constructor
during the first connection attempt.
2018-09-24 15:50:59 +02:00
Michael Friedrich
3038b150a9
Merge pull request #6616 from Icinga/feature/tls-handshake-timeout-config
Add ApiListener#tls_handshake_timeout option
2018-09-17 11:20:12 +02:00
Michael Friedrich
b81ac972b9 Silence compiler warning for nice() 2018-09-14 14:29:52 +02:00
Michael Friedrich
29701b4db5 Add ApiListener#tls_handshake_timeout option
This allows to specify the previously hardcoded
timeout of 10s.

refs #6517
2018-09-14 09:20:09 +02:00
Michael Friedrich
f297881e23 Call SSL_shutdown() at least twice 2018-09-10 16:10:16 +02:00
Michael Friedrich
1c2a59bf63
Merge pull request #6591 from Icinga/bugfix/lto-builds-static-initialize-namespaces
Fix static initializer priority for namespaces in LTO builds
2018-09-04 16:54:30 +02:00
Michael Friedrich
19993df380 Fix static initializer priority for namespaces in LTO builds
fixes #6575
2018-09-04 16:36:22 +02:00
Jean Flach
72cc41d14e
Merge pull request #6356 from sourcejedi/fix/systemd
Fix logging under systemd
2018-09-04 15:24:43 +02:00
Michael Friedrich
bc844aca06 Fix non-unity builds on CentOS 7 with std::shared_ptr
refs #6509
2018-09-03 15:32:28 +02:00
Alan Jenkins
a0fb0bbfe3 fix "Console" log to flush
It's called "Console", which would be line-buffered anyway.  But, it's
implemented as std::cout.  This might be piped to a logger, as in
daemontools or systemd.  In this case it will not be a TTY, and log lines
should be flushed without too much delay.  Let's just flush each message.

Let's not introduce a static instance of StreamLogger (flushed by interval
timer).  That's too stressful to read, because static instances are really
annoying to order.  Example citation: "Yay, our static destructors are
pretty much beyond repair at this point." -- application.cpp.

I don't know if there will be any need to optimize logging syscalls.  The
init script uses `--daemonize`.  I think the systemd service should also
avoid using the "Console" log after startup (see next commit).  The
documentation does not warn that the syslog feature is less efficient
in system calls than mainlog; deferred flusing does not seem to be a highly
prominent feature.  There's no cool comment in the code about how much the
syscalls were slowing down some use case (or qualifying that this
optimization can only eliminate syscalls on platforms with both mutexes and
clocks that can work without syscalls).
2018-08-25 09:54:55 +01:00
Gunnar Beutner
e678fa1aa5 Refactor Application::*Const() 2018-08-13 15:27:05 +02:00
Gunnar Beutner
1a0311a49f Implement namespace support for the keys() function 2018-08-13 13:44:31 +02:00