summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* simplify queue's basic_consume handlerMatthias Radestock2013-02-211-15/+7
| | | | | | | | | | | | | | | | | | - the call to update_ch_record in the is_ch_blocked(C1) == false branch was superfluos since the preceding update_consumer_count calls update_ch_record - all the checking whether the channel is blocked, and associated branching was just an optimisation. And not a particularly important one, since a) the "a new consumer comes along while its channel is blocked" case is hardly on the critical path, and b) exactly the same check is performed as part of run_message_queue (in deliver_msg_to_consumer/3). So get rid of it. - the is_empty & send_drained logic can be invoked earlier, which allows us to use the #cr we have rather than looking it up again. We can do this since the only case we need to catch here is that of a consumer coming along while the queue is empty already. If it becomes empty as part of run_message_queue then send_drained will be invoked in 'fetch'.
* merge default into bug23749Matthias Radestock2013-02-201-1/+1
|\
| * oopsMatthias Radestock2013-02-201-1/+1
| |
* | optimise possibly_unblockMatthias Radestock2013-02-201-15/+18
| | | | | | | | | | when the channel is blocked there is no point going through the expensive consumer re-partitioning
* | refactorMatthias Radestock2013-02-201-9/+6
| | | | | | | | | | it's convenient for callers to have maybe_send_drained thread through the state
* | cosmetic - reduce distance to 'default'Matthias Radestock2013-02-201-20/+17
| |
* | oopsMatthias Radestock2013-02-201-1/+1
| |
* | cosmeticMatthias Radestock2013-02-201-14/+14
| | | | | | | | move functions to a better place
* | merge default into bug23749Matthias Radestock2013-02-201-2/+2
|\ \ | |/
| * introduce is_empty(State) helper in rabbit_amqqueue_processMatthias Radestock2013-02-201-11/+10
| | | | | | | | ported from bug 23749
| * cosmeticMatthias Radestock2013-02-201-2/+2
| |
* | get rid of maybe_send_drained_consMatthias Radestock2013-02-201-14/+14
| | | | | | | | and optimise handle_cast/credit along the way
* | refactor possibly_unblockMatthias Radestock2013-02-201-18/+19
| |
* | introduce is_empty(State) helperMatthias Radestock2013-02-201-20/+17
| | | | | | | | | | and in the resulting refactor also remove a non-linear BQS access in handle_info/drop_expired.
* | cosmeticMatthias Radestock2013-02-201-5/+5
| |
* | eliminate non-linear BQS usageMatthias Radestock2013-02-201-1/+2
| |
* | cosmeticMatthias Radestock2013-02-201-9/+5
| |
* | Only send_drained if we have become empty...Simon MacMullen2013-02-201-9/+13
| |
* | AhemSimon MacMullen2013-02-201-2/+2
| |
* | Be more careful about where we send_drained from.Simon MacMullen2013-02-201-7/+25
| |
* | NeatnessSimon MacMullen2013-02-201-3/+2
| |
* | merge default into bug23749Matthias Radestock2013-02-2012-142/+204
|\ \ | |/
| * Remove spurious blank line in the logs.Simon MacMullen2013-02-201-1/+1
| |
| * merge bug25418 into defaultTim Watson2013-02-201-3/+24
| |\
| | * Auto sync when policy changes to require it, in case we are already mirrored ↵Simon MacMullen2013-02-131-7/+11
| | | | | | | | | | | | but have unsynced slaves at that point.
| | * First pass at ha-sync-mode.Simon MacMullen2013-02-111-4/+21
| | |
| * | stable to defaultSimon MacMullen2013-02-198-78/+74
| |\ \
| | * \ Merge bug25457Simon MacMullen2013-02-197-30/+20
| | |\ \
| | | * \ Merged bug25456 into stableEmile Joubert2013-02-191-1/+5
| | | |\ \
| | | | * \ Merged bug25453 into stableEmile Joubert2013-02-190-0/+0
| | | | |\ \
| | | | * | | Take note of RABBITMQ_SERVICENAME, same as rabbitmq-service.bat does.Simon MacMullen2013-02-151-1/+5
| | | | |/ /
| | | * | | Remove rabbit_runtime_parameter:validate_clear/3, and instead just validate ↵Simon MacMullen2013-02-185-27/+13
| | | | | | | | | | | | | | | | | | | | | | | | that the parameter exists.
| | | * | | It's 'name', not 'key'.Simon MacMullen2013-02-151-2/+2
| | | |/ /
| | * | | Ensure that we resume socket reading in all edge casesMatthias Radestock2013-02-181-48/+54
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specifically in all the cases where handle_other might have changed the connection_state. This is most straightforward and obvious to guarantee by always invoking recvloop after handle_other, unless we are stopping. This does expose an inconsistency in the various non-throw/exit termination cases: two of them were returning State, the other ok. Let's go with the latter; it's easiest. We also take the opportunity to eliminate 'Deb' from the handle_other signature. This is only needed in the {system, ...} message case, which we now handle specially.
| * | | explain a reader subletyMatthias Radestock2013-02-151-1/+3
| | | |
| * | | refactor: more symmetry in rabbit_reader:handle_dependent_exit/3Matthias Radestock2013-02-151-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | It makes no difference whether we call handle_exception before or after control_throttle, so lets use an order that more clearly calls out the similarity to the controlled exit case.
| * | | make reader's handling of channel.close_ok more obviously correctMatthias Radestock2013-02-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | by re-introducing a call to control_throttle. This was present in 3.0.x, and is needed there, but is actually not needed here, due to other changes made in the area. But the reason is quite subtle... For control_throttle to do something here, the channel_cleanup would have to be called for a channel for which we have run out of credit. Now, credit is only consumed when sending content-bearing methods to the channel with rabbit_channel:do_flow. There is a subsequent invocation of control_throttle in the code which will set the connection_state to 'blocking'. But this is immediately followed by a call to post_process_frame. The frame we are looking at must be the last frame of a content-bearing method, since otherwise the method would not be complete and we wouldn't have passed it to the channel. Hence that frame can only be a content_header or, more likely, a content_body. For both of these, post_process_frame invokes maybe_block, which will turn a 'blocking' into 'blocked'. And from that point onwards we will no longer read anything from the socket or process anything already in buf. So we certainly can't be processing a channel.close_ok. In other words, post_process_frame can only be invoked with a channel.close_ok frame when the connection_state is 'running', or blocking/blocked for a reason other than having run out of credit for a channel, i.e. an alarm. Therefore forgetting about the channel as part of the channel_cleanup call does not have an effect on credit_flow:blocked(). And hence an invocation of control_throttle will not alter the connection_state and is therefore unnecessary.
| * | | make reader's handle_dependent_exit clearerMatthias Radestock2013-02-151-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | - handle the no-op case (controlled exit of a channel we've forgotten about already) explicitly - better clause order and formatting.
| * | | TypoSimon MacMullen2013-02-151-1/+1
| | | |
| * | | Merged bug25247Emile Joubert2013-02-155-37/+60
| |\ \ \
| | * | | tweakMatthias Radestock2013-02-151-9/+8
| | | | |
| | * | | explainMatthias Radestock2013-02-151-0/+10
| | | | |
| | * | | merge stable into defaultMatthias Radestock2013-02-1446-1479/+2337
| | |\ \ \ | | | |/ / | | |/| |
| | * | | merge bug25419 into stableMatthias Radestock2013-02-140-0/+0
| | |\ \ \
| | * | | | cosmeticMatthias Radestock2013-02-141-2/+2
| | | | | |
| | * | | | In case the containing process is trapping exits.Simon MacMullen2013-02-141-0/+1
| | | | | |
| | * | | | Don't stomp on the (possible) registered name of the thing that invokes ↵Simon MacMullen2013-02-141-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | boot/0 or start/0, create a new process to hold the name instead.
| | * | | | If we try to stop while starting, wait until we have stopped starting before ↵Simon MacMullen2013-02-141-0/+8
| | |/ / / | | | | | | | | | | | | | | | stopping.
| * | | | remove icky use of element/2Matthias Radestock2013-02-121-4/+5
| | | | |
| * | | | Tweak nodes policy to allow master removal and thus queue migrationSimon MacMullen2013-02-123-49/+73
| | | | |