import libreport-2.15.2-5.el9_b

This commit is contained in:
CentOS Sources 2021-11-04 00:13:36 -04:00 committed by Stepan Oksanichenko
parent 592d98855f
commit b7a5778148
4 changed files with 226 additions and 2 deletions

View File

@ -0,0 +1,48 @@
From 3389fbeb5cf00fd515049a6a9db3c5cc4ca383a0 Mon Sep 17 00:00:00 2001
From: Michal Srb <michal@redhat.com>
Date: Thu, 26 Aug 2021 19:20:52 +0200
Subject: [PATCH] Change the default Bugzilla group
Signed-off-by: Michal Srb <michal@redhat.com>
---
configure.ac | 6 +++---
src/plugins/bugzilla.conf | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/configure.ac b/configure.ac
index fa97fa78..aa383083 100644
--- a/configure.ac
+++ b/configure.ac
@@ -98,14 +98,14 @@ AC_PATH_PROG([XMLRPC], [xmlrpc-c-config], [no])
AC_ARG_WITH([redhatbugzillacreateprivate],
AS_HELP_STRING([--with-redhatbugzillacreateprivate="yes/no"],
[Whether the Red Hat Bugzilla plugin should open
- bugs private by default ("no")]),
- [], [with_redhatbugzillacreateprivate="no"])
+ bugs private by default ("yes")]),
+ [], [with_redhatbugzillacreateprivate="yes"])
AC_SUBST([RED_HAT_BUGZILLA_CREATE_PRIVATE], [$with_redhatbugzillacreateprivate])
AC_ARG_WITH([redhatbugzillaprivategroups],
AS_HELP_STRING([--with-redhatbugzillaprivategroups="CSV"],
[Name of groups separated by comma]),
- [], [with_redhatbugzillaprivategroups="fedora_contrib_private"])
+ [], [with_redhatbugzillaprivategroups="redhat"])
AC_SUBST([RED_HAT_BUGZILLA_PRIVATE_GROUPS], [$with_redhatbugzillaprivategroups])
diff --git a/src/plugins/bugzilla.conf b/src/plugins/bugzilla.conf
index a7727392..dbbbd05c 100644
--- a/src/plugins/bugzilla.conf
+++ b/src/plugins/bugzilla.conf
@@ -22,5 +22,5 @@ Password =
DontMatchComponents = selinux-policy
# for more info about these settings see: https://github.com/abrt/abrt/wiki/FAQ#creating-private-bugzilla-tickets
-# CreatePrivate = no
-# PrivateGroups = fedora_contrib_private
+# CreatePrivate = yes
+# PrivateGroups = redhat
--
2.31.1

View File

@ -0,0 +1,48 @@
From 50fdc7f23f35744ffff1763fe2d804b18c1c5340 Mon Sep 17 00:00:00 2001
From: Michal Srb <michal@redhat.com>
Date: Tue, 7 Sep 2021 14:40:21 +0200
Subject: [PATCH] [rhbz] Be a little bit more defensive when working with
subcomponents
Components in RHEL can have "subcomponents" in Bugzilla. Some of them
have, some of them don't. Better be careful.
See: rhbz#1998435
Signed-off-by: Michal Srb <michal@redhat.com>
---
src/plugins/rhbz.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/src/plugins/rhbz.c b/src/plugins/rhbz.c
index c2855a70..0dae1e93 100644
--- a/src/plugins/rhbz.c
+++ b/src/plugins/rhbz.c
@@ -1036,13 +1036,17 @@ char *rhbz_get_default_sub_component(const char *component, xmlrpc_value *sub_co
}
else
{
- xmlrpc_array_read_item(&env, sub_components, sc_array_size - 1, &sc_struct);
- xmlrpc_struct_find_value(&env, sc_struct, "name", &sc_name);
- xmlrpc_read_string(&env, sc_name, &sc_str_name);
- if (sc_struct)
- xmlrpc_DECREF(sc_struct);
- if (sc_name)
- xmlrpc_DECREF(sc_name);
+ if (sc_array_size) {
+ xmlrpc_array_read_item(&env, sub_components, sc_array_size - 1, &sc_struct);
+ if (xmlrpc_struct_has_key(&env, sc_struct, "name")) {
+ xmlrpc_struct_find_value(&env, sc_struct, "name", &sc_name);
+ xmlrpc_read_string(&env, sc_name, &sc_str_name);
+ }
+ if (sc_struct)
+ xmlrpc_DECREF(sc_struct);
+ if (sc_name)
+ xmlrpc_DECREF(sc_name);
+ }
}
return (char *)sc_str_name;
--
2.31.1

View File

@ -0,0 +1,113 @@
From 28a6267c056d43cdbf8cd3e10e69d8ab113e74f8 Mon Sep 17 00:00:00 2001
From: Michal Srb <michal@redhat.com>
Date: Tue, 7 Sep 2021 21:31:21 +0200
Subject: [PATCH] [rhbz] Retry XML-RPC calls when uploading attachments
If there is a bot that automatically modifies newly opened bugs, then
it can lead to "query serialization error" from Bugzilla. Retry should
help us here.
Signed-off-by: Michal Srb <michal@redhat.com>
---
src/lib/abrt_xmlrpc.c | 34 ++++++++++++++++++++++++++++++++++
src/lib/abrt_xmlrpc.h | 5 +++++
src/lib/libreport-web.sym | 1 +
src/plugins/rhbz.c | 4 +++-
4 files changed, 43 insertions(+), 1 deletion(-)
diff --git a/src/lib/abrt_xmlrpc.c b/src/lib/abrt_xmlrpc.c
index 7cac9253..4c3b469a 100644
--- a/src/lib/abrt_xmlrpc.c
+++ b/src/lib/abrt_xmlrpc.c
@@ -16,6 +16,7 @@
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#include <unistd.h>
#include "internal_libreport.h"
#include "abrt_xmlrpc.h"
#include "proxies.h"
@@ -301,3 +302,36 @@ xmlrpc_value *abrt_xmlrpc_call(struct abrt_xmlrpc *ax,
return result;
}
+
+/* die eventually or return expected results; retry up to 5 times if the error is known */
+xmlrpc_value *abrt_xmlrpc_call_with_retry(const char *fault_substring,
+ struct abrt_xmlrpc *ax,
+ const char *method,
+ const char *format, ...)
+{
+ int retry_counter = 0;
+ xmlrpc_env env;
+
+ va_list args;
+
+ do {
+ // sleep, if this is not the first try;
+ // sleep() can be interrupted, but that's not a big deal here
+ if (retry_counter)
+ sleep(retry_counter);
+
+ va_start(args, format);
+ xmlrpc_value *result = abrt_xmlrpc_call_full_va(&env, ax, method, format, args);
+ va_end(args);
+
+ if (!env.fault_occurred)
+ return result; // success!
+
+ if (env.fault_string && !strstr(env.fault_string, fault_substring)) {
+ // unknown error, don't bother retrying...
+ abrt_xmlrpc_die(&env);
+ }
+ } while (++retry_counter <= 5);
+
+ abrt_xmlrpc_die(&env);
+}
diff --git a/src/lib/abrt_xmlrpc.h b/src/lib/abrt_xmlrpc.h
index 31768ffc..8ddcfc54 100644
--- a/src/lib/abrt_xmlrpc.h
+++ b/src/lib/abrt_xmlrpc.h
@@ -63,6 +63,11 @@ xmlrpc_value *abrt_xmlrpc_call_params(xmlrpc_env *env, struct abrt_xmlrpc *ax,
xmlrpc_value *abrt_xmlrpc_call_full(xmlrpc_env *enf, struct abrt_xmlrpc *ax,
const char *method, const char *format, ...);
+xmlrpc_value *abrt_xmlrpc_call_with_retry(const char *fault_substring,
+ struct abrt_xmlrpc *ax,
+ const char *method,
+ const char *format, ...);
+
#ifdef __cplusplus
}
#endif
diff --git a/src/lib/libreport-web.sym b/src/lib/libreport-web.sym
index 44f5244d..9ab88d3e 100644
--- a/src/lib/libreport-web.sym
+++ b/src/lib/libreport-web.sym
@@ -51,6 +51,7 @@ global:
abrt_xmlrpc_call;
abrt_xmlrpc_call_params;
abrt_xmlrpc_call_full;
+ abrt_xmlrpc_call_with_retry;
/* internal_libreport.h - these symbols are only to be used by libreport developers */
libreport_trim_all_whitespace;
diff --git a/src/plugins/rhbz.c b/src/plugins/rhbz.c
index 0dae1e93..f252f914 100644
--- a/src/plugins/rhbz.c
+++ b/src/plugins/rhbz.c
@@ -643,8 +643,10 @@ int rhbz_attach_blob(struct abrt_xmlrpc *ax, const char *bug_id,
* i -> integer, single argument (int value)
* 6 -> base64, two arguments (char* plain data which will be encoded by xmlrpc-c to base64,
* size_t number of bytes to encode)
+ *
+ * Retry if another user/bot attempted to change the same data.
*/
- result = abrt_xmlrpc_call(ax, "Bug.add_attachment", "{s:(s),s:s,s:s,s:s,s:6,s:i}",
+ result = abrt_xmlrpc_call_with_retry("query serialization error", ax, "Bug.add_attachment", "{s:(s),s:s,s:s,s:s,s:6,s:i}",
"ids", bug_id,
"summary", fn,
"file_name", filename,
--
2.31.1

View File

@ -15,10 +15,13 @@
Summary: Generic library for reporting various problems
Name: libreport
Version: 2.15.2
Release: 2%{?dist}
Release: 5%{?dist}
License: GPLv2+
URL: https://abrt.readthedocs.org/
Source: https://github.com/abrt/%{name}/archive/%{version}/%{name}-%{version}.tar.gz
Patch1: 0001-Change-the-default-Bugzilla-group.patch
Patch2: 0002-rhbz-Be-a-little-bit-more-defensive-when-working-wit.patch
Patch3: 0003-rhbz-Retry-XML-RPC-calls-when-uploading-attachments.patch
BuildRequires: %{dbus_devel}
BuildRequires: gtk3-devel
BuildRequires: curl-devel
@ -277,7 +280,7 @@ data over ftp/scp...
%endif
%prep
%autosetup
%autosetup -p 1
%build
./autogen.sh
@ -652,6 +655,18 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%endif
%changelog
* Tue Sep 07 2021 Michal Srb <michal@redhat.com> - 2.15.2-5
- [reporter-bugzilla] Retry XML-RPC calls
- Related: rhbz#1998210
* Tue Sep 07 2021 Michal Srb <michal@redhat.com> - 2.15.2-4
- [reporter-bugzilla] Fix subcomponent handling
- Related: rhbz#1998210
* Thu Aug 26 2021 Michal Srb <michal@redhat.com> - 2.15.2-3
- Change the default Bugzilla group
- Resolves: rhbz#1998210
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 2.15.2-2
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688