Update to 0.5.0

This commit is contained in:
Davide Cavalca 2021-06-24 07:57:27 -07:00
parent 68e4b1b6d6
commit 52984c3011
6 changed files with 94 additions and 145 deletions

View File

@ -0,0 +1,39 @@
From 076af42b270388f38055fdf60dccbb3001de723a Mon Sep 17 00:00:00 2001
From: Daniel Xu <dlxu@fb.com>
Date: Wed, 23 Jun 2021 16:13:56 -0700
Subject: [PATCH] Check return value for mkstemp()
Summary: Fix build warning. Note we don't use EXPECT()/ASSERT() family of macros b/c they can't be used in setup functions
Reviewed By: htejun, lnyng
Differential Revision: D29340980
fbshipit-source-id: b20ce5ceb057307af9fdc2d9720c56b57418970a
---
src/oomd/StatsTest.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/oomd/StatsTest.cpp b/src/oomd/StatsTest.cpp
index a3ff931..29f7566 100644
--- a/src/oomd/StatsTest.cpp
+++ b/src/oomd/StatsTest.cpp
@@ -21,6 +21,7 @@
#include <json/reader.h>
#include <json/value.h>
#include <sys/socket.h>
+#include <exception>
#include <iostream>
#include <optional>
#include "oomd/StatsClient.h"
@@ -53,7 +54,9 @@ class StatsTest : public ::testing::Test {
protected:
std::unique_ptr<Stats> get_instance() {
socket_path = "/tmp/oomd-XXXXXX.socket";
- ::mkstemps(socket_path.data(), 7);
+ if (::mkstemps(socket_path.data(), 7) == -1) {
+ throw std::runtime_error("Failed to create temp socket");
+ }
return Stats::get_for_unittest(socket_path);
}
};

View File

@ -0,0 +1,44 @@
From 3989e169fc0da9c29da8dd692427d4f4c1ace413 Mon Sep 17 00:00:00 2001
From: Daniel Xu <dlxu@fb.com>
Date: Wed, 23 Jun 2021 18:17:26 -0700
Subject: [PATCH] Fix ODR violation in tests
Summary: ContinuePlugin was defined twice. Namespace the test one to avoid ODR issues.
Reviewed By: davide125
Differential Revision: D29346385
fbshipit-source-id: 58fdde38a64c8bd22d14d55d0ba04ae865d2fabf
---
src/oomd/config/ConfigCompilerTest.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/oomd/config/ConfigCompilerTest.cpp b/src/oomd/config/ConfigCompilerTest.cpp
index ecf2b92..abe5d10 100644
--- a/src/oomd/config/ConfigCompilerTest.cpp
+++ b/src/oomd/config/ConfigCompilerTest.cpp
@@ -36,6 +36,7 @@ using namespace Oomd::Config2;
using namespace Oomd::Engine;
namespace {
+
int prerun_count;
int prerun_stored_count;
int count;
@@ -57,6 +58,7 @@ void reset_counters() {
static constexpr auto kRandomCgroupFs = "oomd/fixtures/cgroup";
namespace Oomd {
+namespace test {
class ContinuePlugin : public BasePlugin {
public:
@@ -308,6 +310,7 @@ REGISTER_PLUGIN(NoInit, NoInitPlugin::create);
REGISTER_PREKILL_HOOK(NoOpPrekillHook, NoOpPrekillHook::create);
REGISTER_PLUGIN(Kill, KillPlugin::create);
+} // namespace test
} // namespace Oomd
class CompilerTest : public ::testing::Test {

View File

@ -1,28 +0,0 @@
From 9f3c61cc34a285133e2a7672a3d12b1ba399b646 Mon Sep 17 00:00:00 2001
From: Davide Cavalca <dcavalca@fb.com>
Date: Thu, 18 Feb 2021 10:01:34 -0800
Subject: [PATCH] oomd: one more missing include
Summary: Missed this in D26508041 (https://github.com/facebookincubator/oomd/commit/e7403438de998a56ccceefa3e25d7af0fdcbffc2) due to the linter reordering stuff.
Reviewed By: dschatzberg
Differential Revision: D26515168
fbshipit-source-id: 9cdf9f95757f311eb74940044d4be4d53b9c5de8
---
src/oomd/StatsClient.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/oomd/StatsClient.h b/src/oomd/StatsClient.h
index 227f744..452d92a 100644
--- a/src/oomd/StatsClient.h
+++ b/src/oomd/StatsClient.h
@@ -18,6 +18,7 @@
#pragma once
#include <sys/un.h>
+#include <optional>
#include <string>
#include <unordered_map>

View File

@ -1,110 +0,0 @@
From e7403438de998a56ccceefa3e25d7af0fdcbffc2 Mon Sep 17 00:00:00 2001
From: Davide Cavalca <dcavalca@fb.com>
Date: Thu, 18 Feb 2021 08:17:03 -0800
Subject: [PATCH] oomd: fix missing includes for gcc-11
Summary:
This in an import of a patch currently applied in the Fedora
packaging. This patch was authored by Jeff Law <law@redhat.com> in
https://src.fedoraproject.org/rpms/oomd/c/3844a403b26cedf9d1066d2feb95fd9b90f6bc34?branch=rawhide
Reviewed By: dschatzberg
Differential Revision: D26508041
fbshipit-source-id: a9e0db47370a84a9363f79e9bd0fd5236d40aed5
---
src/oomd/Stats.cpp | 1 +
src/oomd/StatsClient.cpp | 1 +
src/oomd/StatsTest.cpp | 1 +
src/oomd/config/JsonConfigParser.cpp | 1 +
src/oomd/include/CgroupPath.cpp | 1 +
src/oomd/util/Fs.cpp | 2 ++
src/oomd/util/FsTest.cpp | 1 +
7 files changed, 8 insertions(+)
diff --git a/src/oomd/Stats.cpp b/src/oomd/Stats.cpp
index cc66bc4..9c866ca 100644
--- a/src/oomd/Stats.cpp
+++ b/src/oomd/Stats.cpp
@@ -27,6 +27,7 @@
#include <chrono>
#include <cstring>
#include <iostream>
+#include <optional>
#include "oomd/Stats.h"
#include "oomd/StatsClient.h"
diff --git a/src/oomd/StatsClient.cpp b/src/oomd/StatsClient.cpp
index ce17ecf..f950e0d 100644
--- a/src/oomd/StatsClient.cpp
+++ b/src/oomd/StatsClient.cpp
@@ -23,6 +23,7 @@
#include <sys/un.h>
#include <unistd.h>
#include <iostream>
+#include <optional>
#include <vector>
#include "oomd/Stats.h"
#include "oomd/util/ScopeGuard.h"
diff --git a/src/oomd/StatsTest.cpp b/src/oomd/StatsTest.cpp
index db70983..a3ff931 100644
--- a/src/oomd/StatsTest.cpp
+++ b/src/oomd/StatsTest.cpp
@@ -22,6 +22,7 @@
#include <json/value.h>
#include <sys/socket.h>
#include <iostream>
+#include <optional>
#include "oomd/StatsClient.h"
#include "oomd/util/Util.h"
diff --git a/src/oomd/config/JsonConfigParser.cpp b/src/oomd/config/JsonConfigParser.cpp
index 50b1d40..c4ae13c 100644
--- a/src/oomd/config/JsonConfigParser.cpp
+++ b/src/oomd/config/JsonConfigParser.cpp
@@ -17,6 +17,7 @@
#include "oomd/config/JsonConfigParser.h"
+#include <optional>
#include <sstream>
#include <json/reader.h>
diff --git a/src/oomd/include/CgroupPath.cpp b/src/oomd/include/CgroupPath.cpp
index addbf74..665c1e7 100644
--- a/src/oomd/include/CgroupPath.cpp
+++ b/src/oomd/include/CgroupPath.cpp
@@ -18,6 +18,7 @@
#include "oomd/include/CgroupPath.h"
#include <exception>
+#include <optional>
#include "oomd/util/Fs.h"
#include "oomd/util/Util.h"
diff --git a/src/oomd/util/Fs.cpp b/src/oomd/util/Fs.cpp
index 4fc669f..3389cbd 100644
--- a/src/oomd/util/Fs.cpp
+++ b/src/oomd/util/Fs.cpp
@@ -15,6 +15,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#include <optional>
+
#include "oomd/util/Fs.h"
#include <dirent.h>
diff --git a/src/oomd/util/FsTest.cpp b/src/oomd/util/FsTest.cpp
index 362c7e5..4ce31ba 100644
--- a/src/oomd/util/FsTest.cpp
+++ b/src/oomd/util/FsTest.cpp
@@ -15,6 +15,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#include <optional>
#include <utility>
#include <vector>

View File

@ -2,15 +2,16 @@
Name: oomd
Summary: Userspace Out-Of-Memory (OOM) killer
Version: 0.4.0
Release: 6%{dist}
Version: 0.5.0
Release: 1%{dist}
License: GPLv2
URL: https://github.com/facebookincubator/oomd/
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
# oomd: fix missing includes for gcc-11
Patch0: %{url}/commit/e7403438de998a56ccceefa3e25d7af0fdcbffc2.patch
# oomd: one more missing include
Patch1: %{url}/commit/9f3c61cc34a285133e2a7672a3d12b1ba399b646.patch
# Check return value for mkstemp()
Patch0: %{url}/commit/076af42b270388f38055fdf60dccbb3001de723a.patch
# Fix ODR violation in tests
Patch1: %{url}/commit/3989e169fc0da9c29da8dd692427d4f4c1ace413.patch
ExcludeArch: i686 armv7hl
@ -76,6 +77,9 @@ Furthermore, time spent livedlocked in kernelspace is minimized.
%systemd_postun_with_restart oomd.service
%changelog
* Wed Jun 23 2021 Davide Cavalca <dcavalca@fedoraproject.org> - 0.5.0-1
- Update to 0.5.0
* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.4.0-6
- Rebuilt for updated systemd-rpm-macros
See https://pagure.io/fesco/issue/2583.

View File

@ -1 +1 @@
SHA512 (oomd-0.4.0.tar.gz) = 6bf5668eedd093666abf290ec8a864e4028deb29605a35da31d8ba9eb4ae18322ec0bb214e683d5c5a8c2e1fdf17d3f81645ca0ff9a07316a172e2a7765de046
SHA512 (oomd-0.5.0.tar.gz) = 1841245c56c9de359b8b9d5e03325430e5b1300b6210f94d810ba3857506658ba9162460baf5ae683a797b534215baa30cefca6daa207d257e30b7c5bd1ac33d