Commit Graph

221 Commits

Author SHA1 Message Date
Julian Brost 2dcdae4470 Remove redundant call to Serialize() in ConfigItem::Commit()
The very same object is already serialized a few lines above, the result is
even stored in a variable, but that variable was not used before. Simply using
this variable results in a noticeable improvement of config validation times.
2022-04-28 17:09:16 +02:00
Yonas Habteab fb21345bfd ConfigItem: Use atomic variables for notified and commited items count 2022-02-25 15:17:33 +01:00
Julian Brost 36ce7d961f Rename silent parameter of ConfigItem::ActivateItems()
As silent now no longer only controls the generation of log messages, a better
name is required. This changes its name, inverts its value to reflect the new
name and adds a documentation comment.
2021-06-21 16:07:36 +02:00
Julian Brost 05ca30a6a0 Write early log messages to the Windows Event Log
When Icinga 2 is started as a service, the early log messages generated
until the FileLogger object is activated are lost and make it really
hard to debug issues that (only) occur when Icinga 2 reloads.

With this commit, these early log messages are written to the Windows
Event Log.
2021-06-21 15:15:54 +02:00
Alexander A. Klimov c3388e9af6 Use std::mutex, not boost::mutex 2021-02-03 09:54:57 +01:00
Julian Brost e727675aaf Remove incorrect assertion in ConfigItem::ActivateItems
There is an assertion that after activating items, all these items are
active, which sounds reasonable at first. However, with concurrent API
queries, some of these could already be deleted and therefore be
deactivated again.
2021-01-15 16:40:07 +01:00
Julian Brost 0c6abc817b Remove upq from ConfigItem::ActivateItems
Since commit d9010c7b9f, ActivateItems no
longer uses the WorkQueue upq to perform tasks but instead performs
these locally. One instance of `upq.Join()`/`upq.HasExceptions()`
remained in the function, but I believe this was just missed when
removing the `upq.Enqueue()` call just before.

This commit removes the corresponding parameter and updates all call
sites accordingly.
2021-01-13 15:19:55 +01:00
Alexander A. Klimov aa4cad7482 Replace std::shared_ptr<Expression> with Expression::Ptr
refs #7361
2019-10-21 17:10:51 +02:00
Michael Friedrich c30edd0a34 Fix message origin for runtime created config object (create/delete events) 2019-08-13 15:05:47 +02:00
Alexander A. Klimov ba842403ce Fix circular #include
refs #6985
2019-04-25 08:25:28 +02: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 dab53448bc icinga.com: Update *.{h,c}pp 2018-10-18 09:27:04 +02:00
Michael Friedrich 85e161ea1e Silence config compiler logging for runtime created objects
This is especially problematic with many single creation requests,
e.g. many downtimes created via Icinga Web 2 & the REST API.

In addition to the config compiler messages, apply rule matches are
also in there which are removed by this patch.
2018-10-09 16:41:17 +02:00
Jean Flach 8fe490f945 Update variable names 2018-09-04 11:45:35 +02:00
Markus Frosch 13a8fa20f9 Ensure that config object types are committed in dependent load order 2018-09-04 11:45:35 +02:00
Jean Flach c721c302cd Shuffle items before config validation 2018-09-04 11:10:27 +02:00
Gunnar Beutner e678fa1aa5 Refactor Application::*Const() 2018-08-13 15:27:05 +02:00
Gunnar Beutner d9c0b6f806 Refactor REGISTER_SCRIPTFUNCTION_* macros 2018-08-13 13:44:31 +02:00
Markus Frosch 9fbc40615a Improve path handling in cmake and daemon 2018-08-07 14:10:26 +02:00
Gunnar Beutner 56cf64f590 Improve error message for serializing objects with recursive references 2018-08-02 11:06:24 +02:00
Michael Friedrich fc2da5047c Fix debug build log entry for ConfigItem activation priority
This is not visible in release builds, minor fix.
2018-07-19 12:53:28 +02:00
Jean Flach c54e042942 Add activation priorities for config object types
This patch ensures that specific configuration types
are pre-activated and post-activated. In general,
logging is first, then common configuration objects
like host/service, downtimes, etc.
In the end, all features are activated after to ensure
that notifications are only sent once downtimes are applied.
A similar thing happens for starting with checks too early.
The ApiListener feature runs first to allow cluster connections
at first glance.

fixes #6057
fixes #6231
2018-05-04 11:25:47 +02:00
Michael Friedrich 495b6906f7 Fix wrong type logging in ConfigItem::Commit 2018-02-09 14:04:50 +01:00
Gunnar Beutner c2fb9fe226 Use initializer lists for arrays and dictionaries 2018-01-16 12:27:44 +01:00
Gunnar Beutner d9010c7b9f Avoid mutex contention in the config parser 2018-01-08 15:59:55 +01:00
Gunnar Beutner becfa85094 Apply clang-tidy fix 'modernize-use-emplace' 2018-01-04 12:24:57 +01:00
Gunnar Beutner e3ad0be769 Apply clang-tidy fix 'modernize-use-auto' 2018-01-04 12:24:57 +01:00
Gunnar Beutner 621eed3f13 Apply clang-tidy fix 'modernize-pass-by-value' 2018-01-04 12:24:57 +01:00
Gunnar Beutner 9ca682496c Apply clang-tidy fix 'modernize-use-override' 2018-01-04 12:24:57 +01:00
Gunnar Beutner ac155d1dda Apply clang-tidy fix 'modernize-redundant-void-arg' 2018-01-04 12:24:57 +01:00
Gunnar Beutner efe99a3e5e Add the final keyword to classes 2018-01-04 05:20:20 +00:00
Gunnar Beutner abe3f8a959 Build fix for Debian wheezy 2018-01-03 10:32:33 +01:00
Michael Insel 158ae2188e Change copyright header for 2018 2018-01-02 12:08:55 +01:00
Jean Flach 2636e6a77a Whitespace fix
What does this change?
* Remove use of spaces for formatting
These could be found by using `grep -r -l -P '^\t+ +[^*]'
* Removal of training whitespaces
* A few lines longer than 120 chars
2017-12-20 14:53:52 +01:00
Gunnar Beutner ab8386cf5c Use std::unique_ptr for Expression objects 2017-12-15 10:44:54 +01:00
Gunnar Beutner 325e4a2fb9 Use nullptr instead of <Type>::Ptr() 2017-11-30 17:47:09 +01:00
Gunnar Beutner 3c60fbf75d Use std::vector::emplace_back instead of std::vector::push_back 2017-11-30 17:47:09 +01:00
Gunnar Beutner 6d09efc907 Use std::shared_ptr instead of boost::shared_ptr 2017-11-30 17:41:00 +01:00
Gunnar Beutner 858873b940 Replace boost::bind/boost::function with std::bind/std::function 2017-11-27 15:15:11 +01:00
Gunnar Beutner 7e3b664140 Add missing ->GetName() calls
fixes #5256
2017-05-15 11:11:08 +02:00
Gunnar Beutner d05b7c4178 Allow expressions for the type in object/template declarations 2017-05-11 14:21:30 +02:00
Gunnar Beutner f9f3358d09 Make sure all objects are set to 'active' before calling the Start() method
fixes #5224
2017-05-04 10:37:34 +02:00
Gunnar Beutner 4134f7fe42 Make sure modified attributes are applied before calling the objects' Start method
refs #4696
2017-05-03 12:02:19 +02:00
Gunnar Beutner 5d45c74be3 Improve function metadata by adding arguments
fixes #5087
2017-03-27 14:43:19 +02:00
Gunnar Beutner 446490ceb3 Fix crash in ConfigItem::RemoveIgnoredItems
fixes #4952
2017-02-01 12:56:53 +01:00
Michael Friedrich b7caf0820d Ensure that *.icinga.com is used everywhere
fixes #13897
fixes #13277
2017-01-10 17:19:12 +01:00
Gunnar Beutner 32e6da1c60 Speed up item lookups for ConfigItem::GetDefaultTemplates
refs #12575
2016-08-29 08:40:46 +02:00
Gunnar Beutner f12b52f465 Use lambdas in the ConfigItem class
refs #12509
2016-08-29 08:16:33 +02:00
Gunnar Beutner 78cd56e277 Implement support for default templates
fixes #12575
2016-08-28 10:27:43 +02:00
Gunnar Beutner 5058c5d75b Use 'auto' for iterator declarations
fixes #12561
2016-08-27 08:37:19 +02:00