Commit 748b6efb authored by Otto Kekäläinen's avatar Otto Kekäläinen

Apply upstream patch for FTBFS on hppa/hurd/kfreebsd-* (Closes: #927846)

Source: https://github.com/codership/galera/issues/539
parent 34151f7d
Pipeline #53172 failed with stages
in 27 minutes and 28 seconds
galera-3 (25.3.26-2~exp1) experimental; urgency=medium
* Apply upstream patch for FTBFS on hppa, hurd and kfreebsd-*
(Closes: #927846)
-- Otto Kekäläinen <otto@debian.org> Fri, 07 Jun 2019 09:49:57 +0300
galera-3 (25.3.26-1) unstable; urgency=medium
* New upstream version 25.3.26
......
From e8c356307fbf3c79642a87785a4c2eba9794d92a Mon Sep 17 00:00:00 2001
From: Teemu Ollakka <teemu.ollakka@galeracluster.com>
Date: Fri, 3 May 2019 11:29:57 +0300
Subject: [PATCH] codership/galera#539 Do not fail in setschedparam if not
supported
Forwarded: https://github.com/codership/galera/issues/539
Do not fail when trying to set scheduling parameters in the system
where the functionality is not supported. Instead print a warning
in the error log and ignore future calls.
---
galerautils/src/gu_thread.cpp | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/galerautils/src/gu_thread.cpp b/galerautils/src/gu_thread.cpp
index e307f6e3..40a956e9 100644
--- a/galerautils/src/gu_thread.cpp
+++ b/galerautils/src/gu_thread.cpp
@@ -7,6 +7,7 @@
#include "gu_utils.hpp"
#include "gu_string_utils.hpp"
#include "gu_throw.hpp"
+#include "gu_logger.hpp"
#include <iostream>
#include <vector>
@@ -78,8 +79,11 @@ gu::ThreadSchedparam gu::thread_get_schedparam(pthread_t thd)
return ThreadSchedparam(policy, sp.sched_priority);
}
+static bool schedparam_not_supported(false);
+
void gu::thread_set_schedparam(pthread_t thd, const gu::ThreadSchedparam& sp)
{
+ if (schedparam_not_supported) return;
#if defined(__sun__)
struct sched_param spstr = { sp.prio(), { 0, } /* sched_pad array */};
#else
@@ -88,6 +92,17 @@ void gu::thread_set_schedparam(pthread_t thd, const gu::ThreadSchedparam& sp)
int err;
if ((err = pthread_setschedparam(thd, sp.policy(), &spstr)) != 0)
{
- gu_throw_error(err) << "Failed to set thread schedparams " << sp;
+ if (err == ENOSYS)
+ {
+ log_warn << "Function pthread_setschedparam() is not implmented "
+ << "in this system. Future attempts to change scheduling "
+ << "priority will be no-op";
+
+ schedparam_not_supported = true;
+ }
+ else
+ {
+ gu_throw_error(err) << "Failed to set thread schedparams " << sp;
+ }
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment