Hello community, here is the log from the commit of package icinga2 for openSUSE:Factory checked in at 2018-11-14 14:43:56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/icinga2 (Old) and /work/SRC/openSUSE:Factory/.icinga2.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "icinga2" Wed Nov 14 14:43:56 2018 rev:15 rq:648915 version:2.10.2 Changes: -------- --- /work/SRC/openSUSE:Factory/icinga2/icinga2.changes 2018-10-29 14:58:24.885973929 +0100 +++ /work/SRC/openSUSE:Factory/.icinga2.new/icinga2.changes 2018-11-14 14:44:39.522592929 +0100 @@ -1,0 +2,29 @@ +Wed Nov 14 09:53:40 UTC 2018 - [email protected] + +- update to 2.10.2 + * Bug + - #6770 (PR): Fix deadlock in GraphiteWriter + - #6769 (Cluster): Hanging TLS connections + - #6759 (Log, PR): Fix possible double free in StreamLogger::BindStream() + - #6753: Icinga2.service state is reloading in systemd after safe-reload until systemd time-out + - #6740 (DB IDO, PR): DB IDO: Don't enqueue queries when the feature is paused (HA) + - #6738 (API, Cluster, PR): Ensure that API/JSON-RPC messages in the same session are processed and not stalled + - #6736 (Crash): Stability issues with Icinga 2.10.x + - #6717 (API, PR): Improve error handling for invalid child_options for API downtime actions + - #6712 (API): Downtime name not returned when error occurs + - #6711 (API, Cluster): Slow API (TLS-Handshake) + - #6709 (PR): Fix the Icinga2 version check for versions with more than 5 characters + - #6707 (Compat, PR): Fix regression for wrong objects.cache path overwriting icinga2.debug file + - #6705 (CLI, Compat, Configuration): Crash "icinga2 object list" command with 2.10.1-1 on CentOS 7 + - #6703: Check command 'icinga' breaks when vars.icinga_min_version is defined (2.10.x) + - #6635 (API): API TLS session connection closed after 2 requests + - #5876 (DB IDO): IDO Work queue on the inactive node growing when switching connection between redundant master servers + * Documentation + - #6714 (Documentation, PR): Docs: Add package related changes to the upgrading docs + * Support + - #6773 (Installation, Packages, PR): Initialize ICINGA2_ERROR_LOG inside the systemd environment + - #6771 (Tests, PR): Implement unit tests for Dictionary initializers + - #6760 (Packages, Tests, PR): armhf: Apply workaround for timer tests with std::bind callbacks + - #6710 (Packages): Crash when upgrading from 2.10.0 to 2.10.1 (SELinux related) + +------------------------------------------------------------------- Old: ---- v2.10.1.tar.gz New: ---- v2.10.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ icinga2.spec ++++++ --- /var/tmp/diff_new_pack.x4aeYF/_old 2018-11-14 14:44:40.458591824 +0100 +++ /var/tmp/diff_new_pack.x4aeYF/_new 2018-11-14 14:44:40.462591820 +0100 @@ -86,7 +86,7 @@ %else %endif # suse Name: icinga2 -Version: 2.10.1 +Version: 2.10.2 Release: %{revision}%{?dist} Url: https://www.icinga.com/ Source: https://github.com/Icinga/%{name}/archive/v%{version}.tar.gz ++++++ v2.10.1.tar.gz -> v2.10.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/icinga2-2.10.1/CHANGELOG.md new/icinga2-2.10.2/CHANGELOG.md --- old/icinga2-2.10.1/CHANGELOG.md 2018-10-18 11:31:02.000000000 +0200 +++ new/icinga2-2.10.2/CHANGELOG.md 2018-11-13 17:13:54.000000000 +0100 @@ -1,5 +1,37 @@ # Icinga 2.x CHANGELOG +## 2.10.2 (2018-11-14) + +### Bug + +* [#6770](https://github.com/icinga/icinga2/issues/6770) (PR): Fix deadlock in GraphiteWriter +* [#6769](https://github.com/icinga/icinga2/issues/6769) (Cluster): Hanging TLS connections +* [#6759](https://github.com/icinga/icinga2/issues/6759) (Log, PR): Fix possible double free in StreamLogger::BindStream\(\) +* [#6753](https://github.com/icinga/icinga2/issues/6753): Icinga2.service state is reloading in systemd after safe-reload until systemd time-out +* [#6740](https://github.com/icinga/icinga2/issues/6740) (DB IDO, PR): DB IDO: Don't enqueue queries when the feature is paused \(HA\) +* [#6738](https://github.com/icinga/icinga2/issues/6738) (API, Cluster, PR): Ensure that API/JSON-RPC messages in the same session are processed and not stalled +* [#6736](https://github.com/icinga/icinga2/issues/6736) (Crash): Stability issues with Icinga 2.10.x +* [#6717](https://github.com/icinga/icinga2/issues/6717) (API, PR): Improve error handling for invalid child\_options for API downtime actions +* [#6712](https://github.com/icinga/icinga2/issues/6712) (API): Downtime name not returned when error occurs +* [#6711](https://github.com/icinga/icinga2/issues/6711) (API, Cluster): Slow API \(TLS-Handshake\) +* [#6709](https://github.com/icinga/icinga2/issues/6709) (PR): Fix the Icinga2 version check for versions with more than 5 characters +* [#6707](https://github.com/icinga/icinga2/issues/6707) (Compat, PR): Fix regression for wrong objects.cache path overwriting icinga2.debug file +* [#6705](https://github.com/icinga/icinga2/issues/6705) (CLI, Compat, Configuration): Crash "icinga2 object list" command with 2.10.1-1 on CentOS 7 +* [#6703](https://github.com/icinga/icinga2/issues/6703): Check command 'icinga' breaks when vars.icinga\_min\_version is defined \(2.10.x\) +* [#6635](https://github.com/icinga/icinga2/issues/6635) (API): API TLS session connection closed after 2 requests +* [#5876](https://github.com/icinga/icinga2/issues/5876) (DB IDO): IDO Work queue on the inactive node growing when switching connection between redundant master servers + +### Documentation + +* [#6714](https://github.com/icinga/icinga2/issues/6714) (Documentation, PR): Docs: Add package related changes to the upgrading docs + +### Support + +* [#6773](https://github.com/icinga/icinga2/issues/6773) (Installation, Packages, PR): Initialize ICINGA2\_ERROR\_LOG inside the systemd environment +* [#6771](https://github.com/icinga/icinga2/issues/6771) (Tests, PR): Implement unit tests for Dictionary initializers +* [#6760](https://github.com/icinga/icinga2/issues/6760) (Packages, Tests, PR): armhf: Apply workaround for timer tests with std::bind callbacks +* [#6710](https://github.com/icinga/icinga2/issues/6710) (Packages): Crash when upgrading from 2.10.0 to 2.10.1 \(SELinux related\) + ## 2.10.1 (2018-10-18) ### Bug diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/icinga2-2.10.1/RELEASE.md new/icinga2-2.10.2/RELEASE.md --- old/icinga2-2.10.1/RELEASE.md 2018-10-18 11:31:02.000000000 +0200 +++ new/icinga2-2.10.2/RELEASE.md 2018-11-13 17:13:54.000000000 +0100 @@ -26,7 +26,7 @@ Specify the release version. ``` -VERSION=2.10.1 +VERSION=2.10.2 ``` Add your signing key to your Git configuration file, if not already there. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/icinga2-2.10.1/VERSION new/icinga2-2.10.2/VERSION --- old/icinga2-2.10.1/VERSION 2018-10-18 11:31:02.000000000 +0200 +++ new/icinga2-2.10.2/VERSION 2018-11-13 17:13:54.000000000 +0100 @@ -1,2 +1,2 @@ -Version: 2.10.1 +Version: 2.10.2 Revision: 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/icinga2-2.10.1/doc/13-addons.md new/icinga2-2.10.2/doc/13-addons.md --- old/icinga2-2.10.1/doc/13-addons.md 2018-10-18 11:31:02.000000000 +0200 +++ new/icinga2-2.10.2/doc/13-addons.md 2018-11-13 17:13:54.000000000 +0100 @@ -94,7 +94,7 @@ ### Dashing Dashboard <a id="addons-visualization-dashing-dashboard"></a> The [Icinga 2 dashboard](https://github.com/dnsmichi/dashing-icinga2) is built -on top of Dashing and uses the [REST API](#icinga2-api) to visualize what's going +on top of Dashing and uses the [REST API](12-icinga2-api.md#icinga2-api) to visualize what's going on with your monitoring. It combines several popular widgets and provides development instructions for your own implementation. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/icinga2-2.10.1/doc/16-upgrading-icinga-2.md new/icinga2-2.10.2/doc/16-upgrading-icinga-2.md --- old/icinga2-2.10.1/doc/16-upgrading-icinga-2.md 2018-10-18 11:31:02.000000000 +0200 +++ new/icinga2-2.10.2/doc/16-upgrading-icinga-2.md 2018-11-13 17:13:54.000000000 +0100 @@ -106,6 +106,22 @@ ```critical/config: Error: Zone 'XXX' can not have a global zone as parent.``` +### Package Changes <a id="upgrading-to-2-10-package-changes"></a> + +Debian/Ubuntu drops the `libicinga2` package. `apt-get upgrade icinga2` +won't remove such packages leaving the upgrade in an unsatisfied state. + +Please use `apt-get full-upgrade` or `apt-get dist-upgrade` instead, as explained [here](https://github.com/Icinga/icinga2/issues/6695#issuecomment-430585915). + +On RHEL/CentOS/Fedora, `icinga2-libs` has been obsoleted. Unfortunately yum's dependency +resolver doesn't allow to install older versions than 2.10 then. Please +read [here](https://github.com/Icinga/icinga-packaging/issues/114#issuecomment-429264827) +for details. + +RPM packages dropped the [Classic UI](16-upgrading-icinga-2.md#upgrading-to-2-8-removed-classicui-config-package) +package in v2.8, Debian/Ubuntu packages were forgotten. This is now the case with this +release. Icinga 1.x is EOL by the end of 2018, plan your migration to [Icinga Web 2](https://icinga.com/docs/icingaweb2/latest/). + ## Upgrading to v2.9 <a id="upgrading-to-2-9"></a> ### Deprecation and Removal Notes <a id="upgrading-to-2-9-deprecation-removal-notes"></a> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/icinga2-2.10.1/etc/initsystem/icinga2.service.cmake new/icinga2-2.10.2/etc/initsystem/icinga2.service.cmake --- old/icinga2-2.10.1/etc/initsystem/icinga2.service.cmake 2018-10-18 11:31:02.000000000 +0200 +++ new/icinga2-2.10.2/etc/initsystem/icinga2.service.cmake 2018-11-13 17:13:54.000000000 +0100 @@ -4,6 +4,7 @@ [Service] Type=notify +Environment="ICINGA2_ERROR_LOG=@ICINGA2_LOGDIR@/error.log" EnvironmentFile=@ICINGA2_SYSCONFIGFILE@ ExecStartPre=@CMAKE_INSTALL_PREFIX@/lib/icinga2/prepare-dirs @ICINGA2_SYSCONFIGFILE@ ExecStart=@CMAKE_INSTALL_FULL_SBINDIR@/icinga2 daemon --close-stdio -e ${ICINGA2_ERROR_LOG} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/icinga2-2.10.1/lib/base/stream.cpp new/icinga2-2.10.2/lib/base/stream.cpp --- old/icinga2-2.10.1/lib/base/stream.cpp 2018-10-18 11:31:02.000000000 +0200 +++ new/icinga2-2.10.2/lib/base/stream.cpp 2018-11-13 17:13:54.000000000 +0100 @@ -91,16 +91,6 @@ return IsDataAvailable() || IsEof(); } -void Stream::SetCorked(bool corked) -{ - m_Corked = corked; -} - -bool Stream::IsCorked() const -{ - return m_Corked; -} - static void StreamDummyCallback() { } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/icinga2-2.10.1/lib/base/stream.hpp new/icinga2-2.10.2/lib/base/stream.hpp --- old/icinga2-2.10.1/lib/base/stream.hpp 2018-10-18 11:31:02.000000000 +0200 +++ new/icinga2-2.10.2/lib/base/stream.hpp 2018-11-13 17:13:54.000000000 +0100 @@ -127,9 +127,6 @@ bool WaitForData(); bool WaitForData(int timeout); - virtual void SetCorked(bool corked); - bool IsCorked() const; - virtual bool SupportsWaiting() const; virtual bool IsDataAvailable() const; @@ -146,8 +143,6 @@ boost::mutex m_Mutex; boost::condition_variable m_CV; - - bool m_Corked{false}; }; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/icinga2-2.10.1/lib/base/streamlogger.cpp new/icinga2-2.10.2/lib/base/streamlogger.cpp --- old/icinga2-2.10.1/lib/base/streamlogger.cpp 2018-10-18 11:31:02.000000000 +0200 +++ new/icinga2-2.10.2/lib/base/streamlogger.cpp 2018-11-13 17:13:54.000000000 +0100 @@ -47,7 +47,7 @@ if (m_FlushLogTimer) m_FlushLogTimer->Stop(); - if (m_OwnsStream) + if (m_Stream && m_OwnsStream) delete m_Stream; } @@ -66,7 +66,7 @@ { ObjectLock olock(this); - if (m_OwnsStream) + if (m_Stream && m_OwnsStream) delete m_Stream; m_Stream = stream; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/icinga2-2.10.1/lib/base/tlsstream.cpp new/icinga2-2.10.2/lib/base/tlsstream.cpp --- old/icinga2-2.10.1/lib/base/tlsstream.cpp 2018-10-18 11:31:02.000000000 +0200 +++ new/icinga2-2.10.2/lib/base/tlsstream.cpp 2018-11-13 17:13:54.000000000 +0100 @@ -153,16 +153,12 @@ char buffer[64 * 1024]; if (m_CurrentAction == TlsActionNone) { - bool corked = IsCorked(); - if (!corked && (revents & (POLLIN | POLLERR | POLLHUP))) + if (revents & (POLLIN | POLLERR | POLLHUP)) m_CurrentAction = TlsActionRead; else if (m_SendQ->GetAvailableBytes() > 0 && (revents & POLLOUT)) m_CurrentAction = TlsActionWrite; else { - if (corked) - ChangeEvents(0); - else - ChangeEvents(POLLIN); + ChangeEvents(POLLIN); return; } @@ -289,7 +285,7 @@ lock.unlock(); - while (!IsCorked() && m_RecvQ->IsDataAvailable() && IsHandlingEvents()) + while (m_RecvQ->IsDataAvailable() && IsHandlingEvents()) SignalDataAvailable(); } @@ -428,18 +424,6 @@ return m_RecvQ->GetAvailableBytes() > 0; } -void TlsStream::SetCorked(bool corked) -{ - Stream::SetCorked(corked); - - boost::mutex::scoped_lock lock(m_Mutex); - - if (corked) - m_CurrentAction = TlsActionNone; - else - ChangeEvents(POLLIN | POLLOUT); -} - Socket::Ptr TlsStream::GetSocket() const { return m_Socket; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/icinga2-2.10.1/lib/base/tlsstream.hpp new/icinga2-2.10.2/lib/base/tlsstream.hpp --- old/icinga2-2.10.1/lib/base/tlsstream.hpp 2018-10-18 11:31:02.000000000 +0200 +++ new/icinga2-2.10.2/lib/base/tlsstream.hpp 2018-11-13 17:13:54.000000000 +0100 @@ -70,8 +70,6 @@ bool SupportsWaiting() const override; bool IsDataAvailable() const override; - void SetCorked(bool corked) override; - bool IsVerifyOK() const; String GetVerifyError() const; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/icinga2-2.10.1/lib/compat/statusdatawriter.cpp new/icinga2-2.10.2/lib/compat/statusdatawriter.cpp --- old/icinga2-2.10.1/lib/compat/statusdatawriter.cpp 2018-10-18 11:31:02.000000000 +0200 +++ new/icinga2-2.10.2/lib/compat/statusdatawriter.cpp 2018-11-13 17:13:54.000000000 +0100 @@ -559,7 +559,8 @@ { CONTEXT("Writing objects.cache file"); - String objectsPath = Configuration::ObjectsPath; + /* Use the compat path here from the .ti generated class. */ + String objectsPath = GetObjectsPath(); std::fstream objectfp; String tempObjectsPath = Utility::CreateTempFile(objectsPath + ".XXXXXX", 0644, objectfp); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/icinga2-2.10.1/lib/db_ido_mysql/idomysqlconnection.cpp new/icinga2-2.10.2/lib/db_ido_mysql/idomysqlconnection.cpp --- old/icinga2-2.10.1/lib/db_ido_mysql/idomysqlconnection.cpp 2018-10-18 11:31:02.000000000 +0200 +++ new/icinga2-2.10.2/lib/db_ido_mysql/idomysqlconnection.cpp 2018-11-13 17:13:54.000000000 +0100 @@ -162,6 +162,9 @@ void IdoMysqlConnection::NewTransaction() { + if (IsPaused()) + return; + #ifdef I2_DEBUG /* I2_DEBUG */ Log(LogDebug, "IdoMysqlConnection") << "Scheduling new transaction and finishing async queries."; @@ -715,6 +718,9 @@ void IdoMysqlConnection::ActivateObject(const DbObject::Ptr& dbobj) { + if (IsPaused()) + return; + #ifdef I2_DEBUG /* I2_DEBUG */ Log(LogDebug, "IdoMysqlConnection") << "Scheduling object activation task for '" << dbobj->GetName1() << "!" << dbobj->GetName2() << "'."; @@ -727,6 +733,9 @@ { AssertOnWorkQueue(); + if (IsPaused()) + return; + if (!GetConnected()) return; @@ -754,6 +763,9 @@ void IdoMysqlConnection::DeactivateObject(const DbObject::Ptr& dbobj) { + if (IsPaused()) + return; + #ifdef I2_DEBUG /* I2_DEBUG */ Log(LogDebug, "IdoMysqlConnection") << "Scheduling object deactivation task for '" << dbobj->GetName1() << "!" << dbobj->GetName2() << "'."; @@ -766,6 +778,9 @@ { AssertOnWorkQueue(); + if (IsPaused()) + return; + if (!GetConnected()) return; @@ -855,6 +870,9 @@ void IdoMysqlConnection::ExecuteQuery(const DbQuery& query) { + if (IsPaused()) + return; + ASSERT(query.Category != DbCatInvalid); #ifdef I2_DEBUG /* I2_DEBUG */ @@ -867,6 +885,9 @@ void IdoMysqlConnection::ExecuteMultipleQueries(const std::vector<DbQuery>& queries) { + if (IsPaused()) + return; + if (queries.empty()) return; @@ -914,6 +935,9 @@ { AssertOnWorkQueue(); + if (IsPaused()) + return; + if (!GetConnected()) return; @@ -942,6 +966,9 @@ { AssertOnWorkQueue(); + if (IsPaused()) + return; + if (!GetConnected()) return; @@ -1129,6 +1156,9 @@ void IdoMysqlConnection::CleanUpExecuteQuery(const String& table, const String& time_column, double max_age) { + if (IsPaused()) + return; + #ifdef I2_DEBUG /* I2_DEBUG */ Log(LogDebug, "IdoMysqlConnection") << "Rescheduling cleanup query for table '" << table << "' and column '" @@ -1142,6 +1172,9 @@ { AssertOnWorkQueue(); + if (IsPaused()) + return; + if (!GetConnected()) return; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/icinga2-2.10.1/lib/db_ido_pgsql/idopgsqlconnection.cpp new/icinga2-2.10.2/lib/db_ido_pgsql/idopgsqlconnection.cpp --- old/icinga2-2.10.1/lib/db_ido_pgsql/idopgsqlconnection.cpp 2018-10-18 11:31:02.000000000 +0200 +++ new/icinga2-2.10.2/lib/db_ido_pgsql/idopgsqlconnection.cpp 2018-11-13 17:13:54.000000000 +0100 @@ -163,6 +163,9 @@ void IdoPgsqlConnection::NewTransaction() { + if (IsPaused()) + return; + m_QueryQueue.Enqueue(std::bind(&IdoPgsqlConnection::InternalNewTransaction, this), PriorityHigh, true); } @@ -569,6 +572,9 @@ void IdoPgsqlConnection::ActivateObject(const DbObject::Ptr& dbobj) { + if (IsPaused()) + return; + m_QueryQueue.Enqueue(std::bind(&IdoPgsqlConnection::InternalActivateObject, this, dbobj), PriorityLow); } @@ -603,6 +609,9 @@ void IdoPgsqlConnection::DeactivateObject(const DbObject::Ptr& dbobj) { + if (IsPaused()) + return; + m_QueryQueue.Enqueue(std::bind(&IdoPgsqlConnection::InternalDeactivateObject, this, dbobj), PriorityLow); } @@ -699,6 +708,9 @@ void IdoPgsqlConnection::ExecuteQuery(const DbQuery& query) { + if (IsPaused()) + return; + ASSERT(query.Category != DbCatInvalid); m_QueryQueue.Enqueue(std::bind(&IdoPgsqlConnection::InternalExecuteQuery, this, query, -1), query.Priority, true); @@ -706,6 +718,9 @@ void IdoPgsqlConnection::ExecuteMultipleQueries(const std::vector<DbQuery>& queries) { + if (IsPaused()) + return; + if (queries.empty()) return; @@ -748,6 +763,9 @@ { AssertOnWorkQueue(); + if (IsPaused()) + return; + if (!GetConnected()) return; @@ -769,6 +787,9 @@ { AssertOnWorkQueue(); + if (IsPaused()) + return; + if (!GetConnected()) return; @@ -933,6 +954,9 @@ void IdoPgsqlConnection::CleanUpExecuteQuery(const String& table, const String& time_column, double max_age) { + if (IsPaused()) + return; + m_QueryQueue.Enqueue(std::bind(&IdoPgsqlConnection::InternalCleanUpExecuteQuery, this, table, time_column, max_age), PriorityLow, true); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/icinga2-2.10.1/lib/icinga/apiactions.cpp new/icinga2-2.10.2/lib/icinga/apiactions.cpp --- old/icinga2-2.10.1/lib/icinga/apiactions.cpp 2018-10-18 11:31:02.000000000 +0200 +++ new/icinga2-2.10.2/lib/icinga/apiactions.cpp 2018-11-13 17:13:54.000000000 +0100 @@ -355,6 +355,15 @@ double startTime = HttpUtility::GetLastParameter(params, "start_time"); double endTime = HttpUtility::GetLastParameter(params, "end_time"); + DowntimeChildOptions childOptions = DowntimeNoChildren; + if (params->Contains("child_options")) { + try { + childOptions = Downtime::ChildOptionsFromValue(HttpUtility::GetLastParameter(params, "child_options")); + } catch (const std::exception&) { + return ApiActions::CreateResult(400, "Option 'child_options' provided an invalid value."); + } + } + String downtimeName = Downtime::AddDowntime(checkable, author, comment, startTime, endTime, fixed, triggerName, duration); @@ -366,10 +375,6 @@ }); /* Schedule downtime for all child objects. */ - DowntimeChildOptions childOptions = DowntimeNoChildren; - if (params->Contains("child_options")) - childOptions = Downtime::ChildOptionsFromValue(HttpUtility::GetLastParameter(params, "child_options")); - if (childOptions != DowntimeNoChildren) { /* 'DowntimeTriggeredChildren' schedules child downtimes triggered by the parent downtime. * 'DowntimeNonTriggeredChildren' schedules non-triggered downtimes for all children. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/icinga2-2.10.1/lib/methods/icingachecktask.cpp new/icinga2-2.10.2/lib/methods/icingachecktask.cpp --- old/icinga2-2.10.1/lib/methods/icingachecktask.cpp 2018-10-18 11:31:02.000000000 +0200 +++ new/icinga2-2.10.2/lib/methods/icingachecktask.cpp 2018-11-13 17:13:54.000000000 +0100 @@ -174,9 +174,13 @@ cr->SetState(ServiceWarning); } - /* Return an error if the version is less than specified (optional). */ - String parsedAppVersion = appVersion.SubStr(1,5); + /* Extract the version number of the running Icinga2 instance. + * We assume that appVersion will allways be something like 'v2.10.1-8-gaebe6da' and we want to extract '2.10.1'. + */ + int endOfVersionNumber = appVersion.FindFirstOf("-") - 1; + String parsedAppVersion = appVersion.SubStr(1, endOfVersionNumber); + /* Return an error if the version is less than specified (optional). */ if (missingIcingaMinVersion.IsEmpty() && !icingaMinVersion.IsEmpty() && Utility::CompareVersion(icingaMinVersion, parsedAppVersion) < 0) { output += "; Minimum version " + icingaMinVersion + " is not installed."; cr->SetState(ServiceCritical); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/icinga2-2.10.1/lib/perfdata/elasticsearchwriter.cpp new/icinga2-2.10.2/lib/perfdata/elasticsearchwriter.cpp --- old/icinga2-2.10.1/lib/perfdata/elasticsearchwriter.cpp 2018-10-18 11:31:02.000000000 +0200 +++ new/icinga2-2.10.2/lib/perfdata/elasticsearchwriter.cpp 2018-11-13 17:13:54.000000000 +0100 @@ -49,15 +49,6 @@ ObjectImpl<ElasticsearchWriter>::OnConfigLoaded(); m_WorkQueue.SetName("ElasticsearchWriter, " + GetName()); - - if (!GetEnableHa()) { - Log(LogDebug, "ElasticsearchWriter") - << "HA functionality disabled. Won't pause connection: " << GetName(); - - SetHAMode(HARunEverywhere); - } else { - SetHAMode(HARunOnce); - } } void ElasticsearchWriter::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/icinga2-2.10.1/lib/perfdata/elasticsearchwriter.ti new/icinga2-2.10.2/lib/perfdata/elasticsearchwriter.ti --- old/icinga2-2.10.1/lib/perfdata/elasticsearchwriter.ti 2018-10-18 11:31:02.000000000 +0200 +++ new/icinga2-2.10.2/lib/perfdata/elasticsearchwriter.ti 2018-11-13 17:13:54.000000000 +0100 @@ -37,10 +37,6 @@ [config] int flush_threshold { default {{{ return 1024; }}} }; - - [config] bool enable_ha { - default {{{ return true; }}} - }; }; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/icinga2-2.10.1/lib/perfdata/graphitewriter.cpp new/icinga2-2.10.2/lib/perfdata/graphitewriter.cpp --- old/icinga2-2.10.1/lib/perfdata/graphitewriter.cpp 2018-10-18 11:31:02.000000000 +0200 +++ new/icinga2-2.10.2/lib/perfdata/graphitewriter.cpp 2018-11-13 17:13:54.000000000 +0100 @@ -282,7 +282,7 @@ msgbuf << "\n"; String metric = msgbuf.str(); - ObjectLock olock(this); + boost::mutex::scoped_lock lock(m_StreamMutex); if (!GetConnected()) return; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/icinga2-2.10.1/lib/perfdata/graphitewriter.hpp new/icinga2-2.10.2/lib/perfdata/graphitewriter.hpp --- old/icinga2-2.10.1/lib/perfdata/graphitewriter.hpp 2018-10-18 11:31:02.000000000 +0200 +++ new/icinga2-2.10.2/lib/perfdata/graphitewriter.hpp 2018-11-13 17:13:54.000000000 +0100 @@ -27,6 +27,7 @@ #include "base/timer.hpp" #include "base/workqueue.hpp" #include <fstream> +#include <boost/thread/mutex.hpp> namespace icinga { @@ -54,6 +55,7 @@ private: Stream::Ptr m_Stream; + boost::mutex m_StreamMutex; WorkQueue m_WorkQueue{10000000, 1}; Timer::Ptr m_ReconnectTimer; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/icinga2-2.10.1/lib/remote/httpserverconnection.cpp new/icinga2-2.10.2/lib/remote/httpserverconnection.cpp --- old/icinga2-2.10.1/lib/remote/httpserverconnection.cpp 2018-10-18 11:31:02.000000000 +0200 +++ new/icinga2-2.10.2/lib/remote/httpserverconnection.cpp 2018-11-13 17:13:54.000000000 +0100 @@ -344,7 +344,6 @@ response.Finish(); m_PendingRequests--; - m_Stream->SetCorked(false); } void HttpServerConnection::DataAvailableHandler() @@ -354,8 +353,6 @@ if (!m_Stream->IsEof()) { boost::recursive_mutex::scoped_lock lock(m_DataHandlerMutex); - m_Stream->SetCorked(true); - try { while (ProcessMessage()) ; /* empty loop body */ @@ -366,8 +363,6 @@ close = true; } - m_RequestQueue.Enqueue(std::bind(&Stream::SetCorked, m_Stream, false)); - /* Request finished, decide whether to explicitly close the connection. */ if (m_CurrentRequest.ProtocolVersion == HttpVersion10 || m_CurrentRequest.Headers->Get("connection") == "close") { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/icinga2-2.10.1/lib/remote/jsonrpcconnection.cpp new/icinga2-2.10.2/lib/remote/jsonrpcconnection.cpp --- old/icinga2-2.10.1/lib/remote/jsonrpcconnection.cpp 2018-10-18 11:31:02.000000000 +0200 +++ new/icinga2-2.10.2/lib/remote/jsonrpcconnection.cpp 2018-11-13 17:13:54.000000000 +0100 @@ -276,8 +276,6 @@ if (!m_Stream->IsEof()) { boost::mutex::scoped_lock lock(m_DataHandlerMutex); - m_Stream->SetCorked(true); - try { while (ProcessMessage()) ; /* empty loop body */ @@ -290,8 +288,6 @@ return; } - - l_JsonRpcConnectionWorkQueues[m_ID % l_JsonRpcConnectionWorkQueueCount].Enqueue(std::bind(&Stream::SetCorked, m_Stream, false)); } else close = true; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/icinga2-2.10.1/test/CMakeLists.txt new/icinga2-2.10.2/test/CMakeLists.txt --- old/icinga2-2.10.1/test/CMakeLists.txt 2018-10-18 11:31:02.000000000 +0200 +++ new/icinga2-2.10.2/test/CMakeLists.txt 2018-11-13 17:13:54.000000000 +0100 @@ -73,6 +73,8 @@ base_convert/tostring base_convert/tobool base_dictionary/construct + base_dictionary/initializer1 + base_dictionary/initializer2 base_dictionary/get1 base_dictionary/get2 base_dictionary/foreach diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/icinga2-2.10.1/test/base-dictionary.cpp new/icinga2-2.10.2/test/base-dictionary.cpp --- old/icinga2-2.10.1/test/base-dictionary.cpp 2018-10-18 11:31:02.000000000 +0200 +++ new/icinga2-2.10.2/test/base-dictionary.cpp 2018-11-13 17:13:54.000000000 +0100 @@ -32,6 +32,28 @@ BOOST_CHECK(dictionary); } +BOOST_AUTO_TEST_CASE(initializer1) +{ + DictionaryData dict; + + dict.emplace_back("test1", "Gin-o-clock"); + + Dictionary::Ptr dictionary = new Dictionary(std::move(dict)); + + Value test1; + test1 = dictionary->Get("test1"); + BOOST_CHECK(test1 == "Gin-o-clock"); +} + +BOOST_AUTO_TEST_CASE(initializer2) +{ + Dictionary::Ptr dictionary = new Dictionary({ {"test1", "Gin-for-the-win"} }); + + Value test1; + test1 = dictionary->Get("test1"); + BOOST_CHECK(test1 == "Gin-for-the-win"); +} + BOOST_AUTO_TEST_CASE(get1) { Dictionary::Ptr dictionary = new Dictionary(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/icinga2-2.10.1/test/base-timer.cpp new/icinga2-2.10.2/test/base-timer.cpp --- old/icinga2-2.10.1/test/base-timer.cpp 2018-10-18 11:31:02.000000000 +0200 +++ new/icinga2-2.10.2/test/base-timer.cpp 2018-11-13 17:13:54.000000000 +0100 @@ -39,16 +39,17 @@ BOOST_CHECK(timer->GetInterval() == 1.5); } -static void Callback(int *counter) +int counter = 0; + +static void Callback(const Timer::Ptr&) { - (*counter)++; + counter++; } BOOST_AUTO_TEST_CASE(invoke) { - int counter; Timer::Ptr timer = new Timer(); - timer->OnTimerExpired.connect(std::bind(&Callback, &counter)); + timer->OnTimerExpired.connect(&Callback); timer->SetInterval(1); counter = 0; @@ -61,9 +62,8 @@ BOOST_AUTO_TEST_CASE(scope) { - int counter; Timer::Ptr timer = new Timer(); - timer->OnTimerExpired.connect(std::bind(&Callback, &counter)); + timer->OnTimerExpired.connect(&Callback); timer->SetInterval(1); counter = 0;
