From 021856d323764f4cb16a4f7c38068c7995733f9d Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Mar 24 2016 16:36:38 +0000 Subject: Ver. 3.6.1 Signed-off-by: Peter Lemenkov --- diff --git a/.gitignore b/.gitignore index 90e760e..46cd1d6 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ rabbitmq-server-1.8.0.tar.gz /rabbitmq-server-3.5.5.tar.gz /rabbitmq-server-3.5.6.tar.gz /rabbitmq-server-3.5.7.tar.gz +/rabbitmq-server-3.6.1.tar.xz diff --git a/rabbitmq-common-0001-Use-ephemeral-port-for-probing.patch b/rabbitmq-common-0001-Use-ephemeral-port-for-probing.patch new file mode 100644 index 0000000..9ca7bfd --- /dev/null +++ b/rabbitmq-common-0001-Use-ephemeral-port-for-probing.patch @@ -0,0 +1,18 @@ +From: John Eckersberg +Date: Fri, 24 Jan 2014 10:47:03 -0500 +Subject: [PATCH] Use ephemeral port for probing + + +diff --git a/src/rabbit_networking.erl b/src/rabbit_networking.erl +index 47309cc..9a64435 100644 +--- a/src/rabbit_networking.erl ++++ b/src/rabbit_networking.erl +@@ -50,7 +50,7 @@ + -include("rabbit.hrl"). + -include_lib("kernel/include/inet.hrl"). + +--define(FIRST_TEST_BIND_PORT, 10000). ++-define(FIRST_TEST_BIND_PORT, 32768). + + %% POODLE + -define(BAD_SSL_PROTOCOL_VERSIONS, [sslv3]). diff --git a/rabbitmq-server-0001-Make-slaves-wait-timeout-configurable-instead-of-har.patch b/rabbitmq-server-0001-Make-slaves-wait-timeout-configurable-instead-of-har.patch new file mode 100644 index 0000000..78e5d48 --- /dev/null +++ b/rabbitmq-server-0001-Make-slaves-wait-timeout-configurable-instead-of-har.patch @@ -0,0 +1,58 @@ +From: Peter Lemenkov +Date: Tue, 2 Feb 2016 17:19:19 +0300 +Subject: [PATCH] Make slaves wait timeout configurable instead of hardcoded + 15000 + +This slightly improves rabbitmq/rabbitmq-server#584 + +Signed-off-by: Peter Lemenkov + +diff --git a/src/rabbit_mirror_queue_master.erl b/src/rabbit_mirror_queue_master.erl +index 057a4fa..e7afe88 100644 +--- a/src/rabbit_mirror_queue_master.erl ++++ b/src/rabbit_mirror_queue_master.erl +@@ -43,7 +43,8 @@ + backing_queue_state, + seen_status, + confirmed, +- known_senders ++ known_senders, ++ wait_timeout + }). + + -ifdef(use_specs). +@@ -130,7 +131,15 @@ init_with_existing_bq(Q = #amqqueue{name = QName}, BQ, BQS) -> + backing_queue_state = BQS, + seen_status = dict:new(), + confirmed = [], +- known_senders = sets:new() }. ++ known_senders = sets:new(), ++ wait_timeout = get_slave_wait_timeout() }. ++ ++get_slave_wait_timeout() -> ++ case application:get_env(rabbit, slave_wait_timeout) of ++ {ok, T} -> T; ++ undefined -> 15000 ++ end. ++ + + stop_mirroring(State = #state { coordinator = CPid, + backing_queue = BQ, +@@ -203,7 +212,7 @@ delete_and_terminate(Reason, State = #state { backing_queue = BQ, + stop_all_slaves(Reason, State), + State#state{backing_queue_state = BQ:delete_and_terminate(Reason, BQS)}. + +-stop_all_slaves(Reason, #state{name = QName, gm = GM}) -> ++stop_all_slaves(Reason, #state{name = QName, gm = GM, wait_timeout = WT}) -> + {ok, #amqqueue{slave_pids = SPids}} = rabbit_amqqueue:lookup(QName), + PidsMRefs = [{Pid, erlang:monitor(process, Pid)} || Pid <- [GM | SPids]], + ok = gm:broadcast(GM, {delete_and_terminate, Reason}), +@@ -215,7 +224,7 @@ stop_all_slaves(Reason, #state{name = QName, gm = GM}) -> + [receive + {'DOWN', MRef, process, _Pid, _Info} -> + ok +- after 15000 -> ++ after WT -> + rabbit_mirror_queue_misc:log_warning( + QName, "Missing 'DOWN' message from ~p in node ~p~n", + [Pid, node(Pid)]), diff --git a/rabbitmq-server-0001-Use-ephemeral-port-for-probing.patch b/rabbitmq-server-0001-Use-ephemeral-port-for-probing.patch deleted file mode 100644 index 0a210b2..0000000 --- a/rabbitmq-server-0001-Use-ephemeral-port-for-probing.patch +++ /dev/null @@ -1,18 +0,0 @@ -From: John Eckersberg -Date: Fri, 24 Jan 2014 10:47:03 -0500 -Subject: [PATCH] Use ephemeral port for probing - - -diff --git a/src/rabbit_networking.erl b/src/rabbit_networking.erl -index f95f8c5..61e3a3a 100644 ---- a/src/rabbit_networking.erl -+++ b/src/rabbit_networking.erl -@@ -39,7 +39,7 @@ - -include("rabbit.hrl"). - -include_lib("kernel/include/inet.hrl"). - ---define(FIRST_TEST_BIND_PORT, 10000). -+-define(FIRST_TEST_BIND_PORT, 32768). - - %% POODLE - -define(BAD_SSL_PROTOCOL_VERSIONS, [sslv3]). diff --git a/rabbitmq-server-0002-Unblock-receive-after-15s.patch b/rabbitmq-server-0002-Unblock-receive-after-15s.patch deleted file mode 100644 index b385125..0000000 --- a/rabbitmq-server-0002-Unblock-receive-after-15s.patch +++ /dev/null @@ -1,26 +0,0 @@ -From: Diana Corbacho -Date: Tue, 26 Jan 2016 13:10:58 +0000 -Subject: [PATCH] Unblock receive after 15s - - -diff --git a/src/rabbit_mirror_queue_master.erl b/src/rabbit_mirror_queue_master.erl -index 7890128..b7c2d9d 100644 ---- a/src/rabbit_mirror_queue_master.erl -+++ b/src/rabbit_mirror_queue_master.erl -@@ -208,7 +208,15 @@ stop_all_slaves(Reason, #state{name = QName, gm = GM}) -> - %% monitor them but they would not have received the GM - %% message. So only wait for slaves which are still - %% not-partitioned. -- [receive {'DOWN', MRef, process, _Pid, _Info} -> ok end -+ [receive -+ {'DOWN', MRef, process, _Pid, _Info} -> -+ ok -+ after 15000 -> -+ rabbit_mirror_queue_misc:log_warning( -+ QName, "Missing 'DOWN' message from ~p in node ~p~n", -+ [Pid, node(Pid)]), -+ ok -+ end - || {Pid, MRef} <- PidsMRefs, rabbit_mnesia:on_running_node(Pid)], - %% Normally when we remove a slave another slave or master will - %% notice and update Mnesia. But we just removed them all, and diff --git a/rabbitmq-server-0003-Make-slaves-wait-timeout-configurable-instead-of-har.patch b/rabbitmq-server-0003-Make-slaves-wait-timeout-configurable-instead-of-har.patch deleted file mode 100644 index 26ea914..0000000 --- a/rabbitmq-server-0003-Make-slaves-wait-timeout-configurable-instead-of-har.patch +++ /dev/null @@ -1,58 +0,0 @@ -From: Peter Lemenkov -Date: Tue, 2 Feb 2016 17:19:19 +0300 -Subject: [PATCH] Make slaves wait timeout configurable instead of hardcoded - 15000 - -This slightly improves rabbitmq/rabbitmq-server#584 - -Signed-off-by: Peter Lemenkov - -diff --git a/src/rabbit_mirror_queue_master.erl b/src/rabbit_mirror_queue_master.erl -index b7c2d9d..f0ddbe8 100644 ---- a/src/rabbit_mirror_queue_master.erl -+++ b/src/rabbit_mirror_queue_master.erl -@@ -41,7 +41,8 @@ - backing_queue_state, - seen_status, - confirmed, -- known_senders -+ known_senders, -+ wait_timeout - }). - - -ifdef(use_specs). -@@ -128,7 +129,15 @@ init_with_existing_bq(Q = #amqqueue{name = QName}, BQ, BQS) -> - backing_queue_state = BQS, - seen_status = dict:new(), - confirmed = [], -- known_senders = sets:new() }. -+ known_senders = sets:new(), -+ wait_timeout = get_slave_wait_timeout() }. -+ -+get_slave_wait_timeout() -> -+ case application:get_env(rabbit, slave_wait_timeout) of -+ {ok, T} -> T; -+ undefined -> 15000 -+ end. -+ - - stop_mirroring(State = #state { coordinator = CPid, - backing_queue = BQ, -@@ -199,7 +208,7 @@ delete_and_terminate(Reason, State = #state { backing_queue = BQ, - stop_all_slaves(Reason, State), - State#state{backing_queue_state = BQ:delete_and_terminate(Reason, BQS)}. - --stop_all_slaves(Reason, #state{name = QName, gm = GM}) -> -+stop_all_slaves(Reason, #state{name = QName, gm = GM, wait_timeout = WT}) -> - {ok, #amqqueue{slave_pids = SPids}} = rabbit_amqqueue:lookup(QName), - PidsMRefs = [{Pid, erlang:monitor(process, Pid)} || Pid <- [GM | SPids]], - ok = gm:broadcast(GM, {delete_and_terminate, Reason}), -@@ -211,7 +220,7 @@ stop_all_slaves(Reason, #state{name = QName, gm = GM}) -> - [receive - {'DOWN', MRef, process, _Pid, _Info} -> - ok -- after 15000 -> -+ after WT -> - rabbit_mirror_queue_misc:log_warning( - QName, "Missing 'DOWN' message from ~p in node ~p~n", - [Pid, node(Pid)]), diff --git a/rabbitmq-server.spec b/rabbitmq-server.spec index 40491aa..69546f9 100644 --- a/rabbitmq-server.spec +++ b/rabbitmq-server.spec @@ -1,16 +1,19 @@ %global erlang_minver R12B-3 +# We want to install into /usr/lib, even on 64-bit platforms +%global _rabbit_libdir %{_exec_prefix}/lib/rabbitmq Name: rabbitmq-server -Version: 3.5.7 -Release: 4%{?dist} +Version: 3.6.1 +Release: 1%{?dist} License: MPLv1.1 Group: Development/Libraries -Source: http://www.rabbitmq.com/releases/rabbitmq-server/v%{version}/%{name}-%{version}.tar.gz +Source: http://www.rabbitmq.com/releases/rabbitmq-server/v%{version}/%{name}-%{version}.tar.xz # curl -O https://raw.githubusercontent.com/rabbitmq/rabbitmq-server/231e90c/scripts/rabbitmq-script-wrapper # sed -i -e "s, @STDOUT_STDERR_REDIRECTION@,,g" rabbitmq-script-wrapper # sed -i -e "s,@SU_RABBITMQ_SH_C@,su rabbitmq -s /bin/sh -c,g" rabbitmq-script-wrapper Source2: rabbitmq-script-wrapper +# curl -O https://raw.githubusercontent.com/lemenkov/rabbitmq-server/cdfc661/packaging/RPMS/Fedora/rabbitmq-server.logrotate Source3: rabbitmq-server.logrotate # curl -O https://raw.githubusercontent.com/rabbitmq/rabbitmq-server/231e90c/scripts/rabbitmq-server.ocf Source4: rabbitmq-server.ocf @@ -19,7 +22,7 @@ Source6: rabbitmq-server.service URL: http://www.rabbitmq.com/ BuildArch: noarch BuildRequires: erlang >= %{erlang_minver}, python-simplejson, xmlto, libxslt, python, zip -BuildRequires: systemd +BuildRequires: systemd Requires: logrotate Requires: erlang-erts%{?_isa} >= %{erlang_minver} Requires: erlang-kernel%{?_isa} >= %{erlang_minver} @@ -42,30 +45,23 @@ Requires(preun): systemd # https://bugzilla.redhat.com/show_bug.cgi?id=998682 # https://bugzilla.redhat.com/show_bug.cgi?id=1032595#c8 -Patch1: rabbitmq-server-0001-Use-ephemeral-port-for-probing.patch +Patch1: rabbitmq-common-0001-Use-ephemeral-port-for-probing.patch # https://bugzilla.redhat.com/1303745 -Patch2: rabbitmq-server-0002-Unblock-receive-after-15s.patch -Patch3: rabbitmq-server-0003-Make-slaves-wait-timeout-configurable-instead-of-har.patch +Patch2: rabbitmq-server-0001-Make-slaves-wait-timeout-configurable-instead-of-har.patch %description RabbitMQ is an implementation of AMQP, the emerging standard for high performance enterprise messaging. The RabbitMQ server is a robust and scalable implementation of an AMQP broker. -# We want to install into /usr/lib, even on 64-bit platforms -%global _rabbit_libdir %{_exec_prefix}/lib/rabbitmq -%global _rabbit_erllibdir %{_rabbit_libdir}/lib/rabbitmq_server-%{version} -%global _plugins_state_dir %{_localstatedir}/lib/rabbitmq/plugins - -%global _maindir %{buildroot}%{_rabbit_erllibdir} - - %prep %setup -q + +cd deps/rabbit_common %patch1 -p1 -b .ephemeral -%patch2 -p1 -b .slave_wait_timeout -%patch3 -p1 -b .slave_wait_timeout_configurable +cd - +%patch2 -p1 -b .slave_wait_timeout_configurable %build @@ -74,10 +70,14 @@ make %{?_smp_mflags} %install -make install TARGET_DIR=%{_maindir} \ - SBIN_DIR=%{buildroot}%{_rabbit_libdir}/bin \ - MAN_DIR=%{buildroot}%{_mandir} \ - DOC_INSTALL_DIR=%{buildroot}%{_pkgdocdir} +make install \ + DESTDIR=%{buildroot} \ + PREFIX=%{_prefix} \ + RMQ_ROOTDIR=%{_rabbit_libdir} + +make install-man \ + DESTDIR=%{buildroot} \ + PREFIX=%{_prefix} mkdir -p %{buildroot}%{_localstatedir}/lib/rabbitmq/mnesia mkdir -p %{buildroot}%{_localstatedir}/log/rabbitmq @@ -93,12 +93,16 @@ install -p -D -m 0644 %{S:3} %{buildroot}%{_sysconfdir}/logrotate.d/rabbitmq-ser install -p -D -m 0644 docs/rabbitmq.config.example %{buildroot}%{_sysconfdir}/rabbitmq/rabbitmq.config -rm %{_maindir}/LICENSE %{_maindir}/LICENSE-* %{_maindir}/INSTALL +rm %{buildroot}%{_rabbit_libdir}/lib/rabbitmq_server-%{version}/{LICENSE,LICENSE-*,INSTALL} install -d %{buildroot}%{_localstatedir}/run/rabbitmq install -p -D -m 0644 %{SOURCE5} %{buildroot}%{_prefix}/lib/tmpfiles.d/%{name}.conf +%check +#make check + + %pre # create rabbitmq group if ! getent group rabbitmq >/dev/null; then @@ -123,9 +127,9 @@ fi %systemd_preun %{name}.service # Clean out plugin activation state, both on uninstall and upgrade -rm -rf %{_plugins_state_dir} +rm -rf %{_localstatedir}/lib/rabbitmq/plugins for ext in rel script boot ; do - rm -f %{_rabbit_erllibdir}/ebin/rabbit.$ext + rm -f %{_rabbit_libdir}/lib/rabbitmq_server-%{version}/ebin/rabbit.$ext done @@ -145,8 +149,7 @@ done %{_sbindir}/rabbitmq-plugins %dir %{_rabbit_libdir} %dir %{_rabbit_libdir}/lib -%{_rabbit_erllibdir} -%{_rabbit_libdir}/bin +%{_rabbit_libdir}/lib/rabbitmq_server-%{version}/ %{_unitdir}/%{name}.service # FIXME this should add dependency on "/usr/lib/ocf/resource.d/" owner %dir /usr/lib/ocf/resource.d/rabbitmq/ @@ -163,6 +166,9 @@ done %changelog +* Thu Mar 24 2016 Peter Lemenkov - 3.6.1-1 +- Ver. 3.6.1 + * Tue Feb 2 2016 Peter Lemenkov - 3.5.7-4 - Remove compatibility triggerun scriptlet - Don't wait for slave stop messages forever (patches #2, #3) diff --git a/sources b/sources index e8fcb38..942b132 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -7208276bd897bdc0e9aff8d5b95a0006 rabbitmq-server-3.5.7.tar.gz +1b07bffb67ad777bcde77b337e49113b rabbitmq-server-3.6.1.tar.xz