diff options
author | Matthias Radestock <matthias@lshift.net> | 2009-06-10 18:33:06 +0100 |
---|---|---|
committer | Matthias Radestock <matthias@lshift.net> | 2009-06-10 18:33:06 +0100 |
commit | 0c0ba7aecefebfd31faee7856d1050bc01d03818 (patch) | |
tree | cc4c0ccb5366a80091f3edd11a9955f442880080 | |
parent | 493bf9aefee4bd18b36a74b346d18c289e7bad70 (diff) | |
parent | 5d0d17cdecae4cca7cffb4e122ad94416b8ccb6d (diff) | |
download | rabbitmq-server-0c0ba7aecefebfd31faee7856d1050bc01d03818.tar.gz |
emergency merge of bug20958 into default
We point to the macports files of the default branch from our web site
and they got broken with the merge of bug20333. This hopefully fixes
that, but further qa is required.
-rw-r--r-- | packaging/RPMS/Fedora/Makefile | 6 | ||||
-rw-r--r-- | packaging/RPMS/Fedora/rabbitmq-server.spec | 2 | ||||
-rw-r--r-- | src/rabbit_amqqueue_process.erl | 27 |
3 files changed, 21 insertions, 14 deletions
diff --git a/packaging/RPMS/Fedora/Makefile b/packaging/RPMS/Fedora/Makefile index 9fe91b98..c74d4533 100644 --- a/packaging/RPMS/Fedora/Makefile +++ b/packaging/RPMS/Fedora/Makefile @@ -13,12 +13,10 @@ endif ifeq "x$(RPM_OS)" "xsuse" REQUIRES=/sbin/chkconfig /sbin/service -OS_DEFINES=--define '_initrddir /etc/init.d' -RELEASE_OS=.suse +OS_DEFINES=--define '_initrddir /etc/init.d' --define 'dist .suse' else REQUIRES=chkconfig initscripts OS_DEFINES=--define '_initrddir /etc/rc.d/init.d' -RELEASE_OS= endif rpms: clean server @@ -27,7 +25,7 @@ prepare: mkdir -p BUILD SOURCES SPECS SRPMS RPMS tmp cp $(TOP_DIR)/$(TARBALL) SOURCES cp rabbitmq-server.spec SPECS - sed -i 's|%%VERSION%%|$(VERSION)|;s|%%REQUIRES%%|$(REQUIRES)|;s|%%RELEASE_OS%%|$(RELEASE_OS)|' \ + sed -i 's|%%VERSION%%|$(VERSION)|;s|%%REQUIRES%%|$(REQUIRES)|' \ SPECS/rabbitmq-server.spec cp init.d SOURCES/rabbitmq-server.init diff --git a/packaging/RPMS/Fedora/rabbitmq-server.spec b/packaging/RPMS/Fedora/rabbitmq-server.spec index 3c3be609..875381e8 100644 --- a/packaging/RPMS/Fedora/rabbitmq-server.spec +++ b/packaging/RPMS/Fedora/rabbitmq-server.spec @@ -2,7 +2,7 @@ Name: rabbitmq-server Version: %%VERSION%% -Release: 1%%RELEASE_OS%% +Release: 1%{?dist} License: MPLv1.1 Group: Development/Libraries Source: http://www.rabbitmq.com/releases/rabbitmq-server/v%{version}/%{name}-%{version}.tar.gz diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl index 7ffb1c8f..f8cfddf1 100644 --- a/src/rabbit_amqqueue_process.erl +++ b/src/rabbit_amqqueue_process.erl @@ -148,7 +148,7 @@ all_ch_record() -> [C || {{ch, _}, C} <- get()]. is_ch_blocked(#cr{unsent_message_count = Count, is_limit_active = Limited}) -> - Limited orelse Count > ?UNSENT_MESSAGE_LIMIT. + Limited orelse Count >= ?UNSENT_MESSAGE_LIMIT. ch_record_state_transition(OldCR, NewCR) -> BlockedOld = is_ch_blocked(OldCR), @@ -630,7 +630,8 @@ handle_call({basic_consume, NoAck, ReaderPid, ChPid, LimiterPid, reply({error, exclusive_consume_unavailable}, State); ok -> C = #cr{consumers = Consumers} = ch_record(ChPid), - Consumer = #consumer{tag = ConsumerTag, ack_required = not(NoAck)}, + Consumer = #consumer{tag = ConsumerTag, + ack_required = not(NoAck)}, store_ch_record(C#cr{consumers = [Consumer | Consumers], limiter_pid = LimiterPid}), if Consumers == [] -> @@ -638,15 +639,23 @@ handle_call({basic_consume, NoAck, ReaderPid, ChPid, LimiterPid, true -> ok end, + ExclusiveConsumer = + if ExclusiveConsume -> {ChPid, ConsumerTag}; + true -> ExistingHolder + end, State1 = State#q{has_had_consumers = true, - exclusive_consumer = - if - ExclusiveConsume -> {ChPid, ConsumerTag}; - true -> ExistingHolder - end, - round_robin = queue:in({ChPid, Consumer}, RoundRobin)}, + exclusive_consumer = ExclusiveConsumer}, ok = maybe_send_reply(ChPid, OkMsg), - reply(ok, run_poke_burst(State1)) + State2 = + case is_ch_blocked(C) of + true -> State1; + false -> run_poke_burst( + State1#q{ + round_robin = queue:in( + {ChPid, Consumer}, + RoundRobin)}) + end, + reply(ok, State2) end end; |