forked from pool/libqb
Accepting request 991002 from network:ha-clustering:Factory
Automatic submission by obs-autosubmit OBS-URL: https://build.opensuse.org/request/show/991002 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libqb?expand=0&rev=34
This commit is contained in:
commit
775eb290be
8
_service
8
_service
@ -1,17 +1,17 @@
|
||||
<services>
|
||||
<service name="tar_scm" mode="disabled">
|
||||
<param name="scm">git</param>
|
||||
<param name="url">git://github.com/ClusterLabs/libqb.git</param>
|
||||
<param name="url">https://github.com/ClusterLabs/libqb.git</param>
|
||||
<param name="package-meta">yes</param>
|
||||
<param name="exclude">.git</param>
|
||||
<!--
|
||||
To update to a new release, change "revision" to the desired
|
||||
git commit hash and bump "version" if necessary
|
||||
|
||||
<param name="version">2.0.4</param>
|
||||
<param name="version">2.0.6</param>
|
||||
-->
|
||||
<param name="versionformat">2.0.4+%cd.%h</param>
|
||||
<param name="revision">v2.0.4</param>
|
||||
<param name="versionformat">2.0.6+%cd.%h</param>
|
||||
<param name="revision">v2.0.6</param>
|
||||
<param name="changesgenerate">enable</param>
|
||||
</service>
|
||||
|
||||
|
@ -3,4 +3,6 @@
|
||||
<param name="url">git://github.com/ClusterLabs/libqb.git</param>
|
||||
<param name="changesrevision">a2691b96188033b5ad5c08871982048ae1f4f4e8</param>
|
||||
</service>
|
||||
</servicedata>
|
||||
<service name="tar_scm">
|
||||
<param name="url">https://github.com/ClusterLabs/libqb.git</param>
|
||||
<param name="changesrevision">758044bed5f615c90818aa5431d00303288888e5</param></service></servicedata>
|
@ -1,78 +0,0 @@
|
||||
From 176eae8f13278a5a3dab3699b84e1dc9a8d4ae11 Mon Sep 17 00:00:00 2001
|
||||
From: Jakub Jankowski <shasta@toxcorp.com>
|
||||
Date: Fri, 14 Jan 2022 08:57:25 +0100
|
||||
Subject: [PATCH] Retry if posix_fallocate is interrupted with EINTR (#453)
|
||||
|
||||
Every now and then Pacemaker reports errors:
|
||||
|
||||
(pcmk__new_client) debug: New IPC client 3efdbecf-c2d9-44bc-b4a6-9bcd48021ba1 for PID 27492 with uid 0 and gid 0
|
||||
(handle_new_connection) debug: IPC credentials authenticated (/dev/shm/qb-7271-27492-12-hfPbKY/qb)
|
||||
(qb_ipcs_shm_connect) debug: connecting to client [27492]
|
||||
(qb_rb_open_2) debug: shm size:524301; real_size:528384; rb->word_size:132096
|
||||
(qb_rb_open_2) debug: shm size:524301; real_size:528384; rb->word_size:132096
|
||||
(qb_sys_mmap_file_open) error: couldn't allocate file /dev/shm/qb-7271-27492-12-hfPbKY/qb-event-cib_rw-data: Interrupted system call (4)
|
||||
(qb_rb_open_2) error: couldn't create file for mmap
|
||||
(qb_ipcs_shm_rb_open) error: qb_rb_open:/dev/shm/qb-7271-27492-12-hfPbKY/qb-event-cib_rw: Interrupted system call (4)
|
||||
(qb_rb_close_helper) debug: Free'ing ringbuffer: /dev/shm/qb-7271-27492-12-hfPbKY/qb-response-cib_rw-header
|
||||
(qb_rb_close_helper) debug: Free'ing ringbuffer: /dev/shm/qb-7271-27492-12-hfPbKY/qb-request-cib_rw-header
|
||||
(qb_ipcs_shm_connect) error: shm connection FAILED: Interrupted system call (4)
|
||||
(handle_new_connection) error: Error in connection setup (/dev/shm/qb-7271-27492-12-hfPbKY/qb): Interrupted system call (4)
|
||||
|
||||
While it probably might be addressed in Pacemaker code, a simple retry
|
||||
loop in case posix_fallocate(3) returns EINTR seems to be a decent
|
||||
workaround.
|
||||
|
||||
Fixes: #451
|
||||
|
||||
Signed-off-by: Jakub Jankowski <shasta@toxcorp.com>
|
||||
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
|
||||
---
|
||||
lib/unix.c | 25 +++++++++++++++++++------
|
||||
1 file changed, 19 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/lib/unix.c b/lib/unix.c
|
||||
index 2fb53d0..b631cbf 100644
|
||||
--- a/lib/unix.c
|
||||
+++ b/lib/unix.c
|
||||
@@ -81,6 +81,9 @@ qb_sys_mmap_file_open(char *path, const char *file, size_t bytes,
|
||||
int32_t i;
|
||||
#endif
|
||||
char *is_absolute = strchr(file, '/');
|
||||
+#ifdef HAVE_POSIX_FALLOCATE
|
||||
+ int32_t fallocate_retry = 5;
|
||||
+#endif
|
||||
|
||||
if (is_absolute) {
|
||||
(void)strlcpy(path, file, PATH_MAX);
|
||||
@@ -121,12 +124,22 @@ qb_sys_mmap_file_open(char *path, const char *file, size_t bytes,
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_POSIX_FALLOCATE
|
||||
- if ((res = posix_fallocate(fd, 0, bytes)) != 0) {
|
||||
- errno = res;
|
||||
- res = -1 * res;
|
||||
- qb_util_perror(LOG_ERR, "couldn't allocate file %s", path);
|
||||
- goto unlink_exit;
|
||||
- }
|
||||
+ /* posix_fallocate(3) can be interrupted by a signal,
|
||||
+ so retry few times before giving up */
|
||||
+ do {
|
||||
+ fallocate_retry--;
|
||||
+ res = posix_fallocate(fd, 0, bytes);
|
||||
+ if (res == EINTR) {
|
||||
+ qb_util_log(LOG_DEBUG, "got EINTR trying to allocate file %s, retrying...", path);
|
||||
+ continue;
|
||||
+ } else if (res != 0) {
|
||||
+ errno = res;
|
||||
+ res = -1 * res;
|
||||
+ qb_util_perror(LOG_ERR, "couldn't allocate file %s", path);
|
||||
+ goto unlink_exit;
|
||||
+ }
|
||||
+ break;
|
||||
+ } while (fallocate_retry > 0);
|
||||
#else
|
||||
if (file_flags & O_CREAT) {
|
||||
long page_size = sysconf(_SC_PAGESIZE);
|
||||
--
|
||||
2.31.1
|
||||
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:49470a4066519efe051dd1d2db21af767fe7c232b3f7c5a99a48a761c82df579
|
||||
size 187804
|
BIN
libqb-2.0.6+20220323.758044b.tar.xz
(Stored with Git LFS)
Normal file
BIN
libqb-2.0.6+20220323.758044b.tar.xz
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -1,3 +1,29 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Apr 21 07:50:45 UTC 2022 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
- Make sure that the libstat_wrapper.so library is included in the libqb-tests RPM (when built)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Mar 23 15:50:36 UTC 2022 - Yan Gao <ygao@suse.com>
|
||||
|
||||
- Update to version 2.0.6+20220323.758044b (v2.0.6):
|
||||
- test: Include ipc_sock.test in the libqb-tests rpm (gh#ClusterLabs/libqb##463)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Mar 23 13:44:10 UTC 2022 - Yan Gao <ygao@suse.com>
|
||||
|
||||
- Update to version 2.0.5+20220321.ccdaada (v2.0.5):
|
||||
- blackbox: Sanitize items read from the blackbox header (gh#ClusterLabs/libqb#438)
|
||||
- ipcc: Fix errno returned from qb_ipcc_connect (gh#ClusterLabs/libqb#460)
|
||||
- util: reimplement time functions as a series of fallbacks (gh#ClusterLabs/libqb#457)
|
||||
- util: use HAVE_GETTIMEOFDAY where appropriate
|
||||
|
||||
- Retry if posix_fallocate is interrupted with EINTR (#453) (gh#ClusterLabs/libqb#451, bsc#1193737, bsc#1193912)
|
||||
- Merge:
|
||||
* bsc#1193737-0001-Retry-if-posix_fallocate-is-interrupted-with-EINTR-4.patch
|
||||
|
||||
- ipcc: Add an async connect API (gh#ClusterLabs/libqb#450)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jan 14 08:06:10 UTC 2022 - Yan Gao <ygao@suse.com>
|
||||
|
||||
|
42
libqb.spec
42
libqb.spec
@ -21,7 +21,7 @@
|
||||
%bcond_without doxygen2man
|
||||
|
||||
Name: libqb
|
||||
Version: 2.0.4+20211112.a2691b9
|
||||
Version: 2.0.6+20220323.758044b
|
||||
Release: 0
|
||||
Summary: An IPC library for high performance servers
|
||||
License: LGPL-2.1-or-later
|
||||
@ -29,8 +29,6 @@ Group: Development/Libraries/C and C++
|
||||
URL: https://github.com/ClusterLabs/libqb
|
||||
Source0: %{name}-%{version}.tar.xz
|
||||
Source1: baselibs.conf
|
||||
Patch1: bsc#1193737-0001-Retry-if-posix_fallocate-is-interrupted-with-EINTR-4.patch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: automake
|
||||
@ -67,8 +65,8 @@ features. It provides logging, tracing, IPC, and polling.
|
||||
%package tools
|
||||
Summary: Utilities from libqb, an IPC library
|
||||
Group: Development/Tools/Other
|
||||
Provides: libqb0:/usr/sbin/qb-blackbox
|
||||
Conflicts: libqb0 <= 1.0.3
|
||||
Provides: libqb0:%{_sbindir}/qb-blackbox
|
||||
|
||||
%description tools
|
||||
libqb is a library providing high performance client server reusable
|
||||
@ -76,7 +74,6 @@ features. It provides logging, tracing, IPC, and polling.
|
||||
|
||||
%prep
|
||||
%setup -q -n %{name}-%{version}
|
||||
%patch1 -p1
|
||||
|
||||
%build
|
||||
if [ ! -f .tarball-version ]; then
|
||||
@ -88,7 +85,7 @@ fi
|
||||
--enable-install-tests \
|
||||
%endif
|
||||
--disable-static
|
||||
make %{?_smp_mflags}
|
||||
%make_build
|
||||
|
||||
%if 0%{?with_check}
|
||||
%check
|
||||
@ -96,15 +93,15 @@ make %{?_smp_mflags}
|
||||
# TODO: This test might not be quite right -- it seems to fail on OBS,
|
||||
# but OBS is capable of doing "make check" successfully, whereas
|
||||
# "osc build" in a chroot fails.
|
||||
if [ -w /dev/shm -a -w /var/run ] ; then
|
||||
if [ -w /dev/shm -a -w %{_localstatedir}/run ] ; then
|
||||
|
||||
make V=1 check
|
||||
%make_build check
|
||||
fi
|
||||
%endif
|
||||
|
||||
%install
|
||||
%make_install
|
||||
find %{buildroot} -name '*.la' -delete
|
||||
find %{buildroot} -type f -name "*.la" -delete -print
|
||||
rm -rf %{buildroot}%{_datadir}/doc
|
||||
|
||||
%post -n libqb100 -p /sbin/ldconfig
|
||||
@ -112,29 +109,28 @@ rm -rf %{buildroot}%{_datadir}/doc
|
||||
%postun -n libqb100 -p /sbin/ldconfig
|
||||
|
||||
%files -n libqb100
|
||||
%doc COPYING
|
||||
%license COPYING
|
||||
%{_libdir}/libqb.so.*
|
||||
|
||||
%files devel
|
||||
%defattr(-,root,root,-)
|
||||
%doc COPYING README.markdown
|
||||
%license COPYING
|
||||
%doc README.markdown
|
||||
%{_includedir}/qb/
|
||||
%{_libdir}/libqb.so
|
||||
%{_libdir}/pkgconfig/libqb.pc
|
||||
%{_mandir}/man3/qb*3*
|
||||
%{_mandir}/man3/qb*3%{?ext_man}
|
||||
|
||||
%files tools
|
||||
%defattr(-,root,root,-)
|
||||
%doc COPYING
|
||||
%license COPYING
|
||||
%{_sbindir}/qb-blackbox
|
||||
%{_mandir}/man8/qb-blackbox.8.gz
|
||||
%{_mandir}/man8/qb-blackbox.8%{?ext_man}
|
||||
|
||||
%package tests
|
||||
Summary: Test suite for %{name}
|
||||
Group: Development/Tools/Other
|
||||
|
||||
%files tests
|
||||
%doc COPYING
|
||||
%files tests
|
||||
%license COPYING
|
||||
%dir %{_libdir}/libqb
|
||||
%dir %{_libdir}/libqb/tests
|
||||
%{_libdir}/libqb/tests/*
|
||||
@ -142,18 +138,18 @@ Group: Development/Tools/Other
|
||||
%description tests
|
||||
The %{name}-tests package contains the %{name} test suite.
|
||||
|
||||
|
||||
%if %{with doxygen2man}
|
||||
%package -n doxygen2man
|
||||
Summary: tool to generate man pages from Doxygen XML files
|
||||
Group: Development/Libraries
|
||||
Requires: libqb100 = %{version}-%{release}
|
||||
Group: Development/Tools/Doc Generators
|
||||
BuildRequires: pkgconfig
|
||||
BuildRequires: pkgconfig(libxml-2.0)
|
||||
Requires: libqb100 = %{version}-%{release}
|
||||
|
||||
%files -n doxygen2man
|
||||
%{_bindir}/doxygen2man
|
||||
%{_mandir}/man1/doxygen2man.1*
|
||||
%doc COPYING
|
||||
%{_mandir}/man1/doxygen2man.1%{?ext_man}
|
||||
%license COPYING
|
||||
|
||||
%description -n doxygen2man
|
||||
The doxygen2man package contains the doxygen2man utility.
|
||||
|
Loading…
x
Reference in New Issue
Block a user