Skip to content

Commit

Permalink
Merge branch 'master' into rabbitmq-server-500
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelklishin committed Jul 1, 2016
2 parents e4884ff + bb1fa55 commit dc7f333
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 19 deletions.
23 changes: 15 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,25 @@ otp_release:
- "18.3"
env:
matrix:
- GROUP=1 GROUP=2
- GROUP=1
- GROUP=2

# The checkout made by Travis is a "detached HEAD". We switch back
# to a tag or a branch. This pleases our git_rmq fetch method in
# rabbitmq-components.mk and the proper tag/branch is selected in
# dependencies too.
# The checkout made by Travis is a "detached HEAD" and branches
# information is missing. Our Erlang.mk's git_rmq fetch method relies on
# it, so we need to restore it.
#
# We simply fetch master and, if it exists, stable branches. A branch is
# created, pointing to the detached HEAD.
before_script:
- ([ "${GROUP}" = "1" ] && ((test "$TRAVIS_TAG" && git checkout "$TRAVIS_TAG") || (test "$TRAVIS_BRANCH" && git checkout "$TRAVIS_BRANCH")) || /bin/true)
- |
git checkout -B "${TRAVIS_TAG:-${TRAVIS_BRANCH}}"
git remote add upstream https://github.com/$TRAVIS_REPO_SLUG.git
git fetch upstream stable:stable || :
git fetch upstream master:master || :
script:
- ([ "${GROUP}" = "1" ] && travis_wait make tests)
- ([ "${GROUP}" = "2" ] && sh ./scripts/travis_test_ocf_ra.sh)
- if test "${GROUP}" = '1'; then make tests CT_OPTS+='-verbosity 50'; fi
- if test "${GROUP}" = '2'; then sh ./scripts/travis_test_ocf_ra.sh; fi

cache:
apt: true
9 changes: 4 additions & 5 deletions packaging/debs/Debian/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ Source: rabbitmq-server
Section: net
Priority: extra
Maintainer: RabbitMQ Team <[email protected]>
Uploaders: Alvaro Videla <[email protected]>,
Michael Klishin <[email protected]>,
Jean-Sébastien Pédron <[email protected]>,
Giuseppe Privitera <[email protected]>
Uploaders: Michael Klishin <[email protected]>,
Karl Nilsson <[email protected]>,
Jean-Sébastien Pédron <[email protected]>
Build-Depends: debhelper (>= 9),
dh-systemd (>= 1.5),
erlang-dev,
Expand All @@ -19,7 +18,7 @@ Standards-Version: 3.9.4

Package: rabbitmq-server
Architecture: all
Depends: erlang-nox (>= 1:16.b.3) | esl-erlang, adduser, logrotate, socat, ${misc:Depends}
Depends: erlang-nox (>= 1:16.b.3) | esl-erlang, adduser, logrotate, socat, init-system-helpers (>= 1.13~)
Description: Multi-protocol messaging broker
RabbitMQ is an open source multi-protocol messaging broker.
Homepage: http://www.rabbitmq.com/
8 changes: 6 additions & 2 deletions src/file_handle_cache.erl
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ open_with_absolute_path(Path, Mode, Options) ->
case IsWriter andalso HasWriter of
true -> {error, writer_exists};
false -> {ok, Ref} = new_closed_handle(Path, Mode1, Options),
case get_or_reopen([{Ref, new}]) of
case get_or_reopen_timed([{Ref, new}]) of
{ok, [_Handle1]} ->
RCount1 = case is_reader(Mode1) of
true -> RCount + 1;
Expand Down Expand Up @@ -674,7 +674,7 @@ with_handles(Refs, Fun) ->
with_handles(Refs, reset, Fun).

with_handles(Refs, ReadBuffer, Fun) ->
case get_or_reopen([{Ref, reopen} || Ref <- Refs]) of
case get_or_reopen_timed([{Ref, reopen} || Ref <- Refs]) of
{ok, Handles0} ->
Handles = case ReadBuffer of
reset -> [reset_read_buffer(H) || H <- Handles0];
Expand Down Expand Up @@ -712,6 +712,10 @@ with_flushed_handles(Refs, ReadBuffer, Fun) ->
end
end).

get_or_reopen_timed(RefNewOrReopens) ->
file_handle_cache_stats:update(
io_file_handle_open_attempt, fun() -> get_or_reopen(RefNewOrReopens) end).

get_or_reopen(RefNewOrReopens) ->
case partition_handles(RefNewOrReopens) of
{OpenHdls, []} ->
Expand Down
2 changes: 1 addition & 1 deletion src/file_handle_cache_stats.erl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
[io_reopen, mnesia_ram_tx, mnesia_disk_tx,
msg_store_read, msg_store_write,
queue_index_journal_write, queue_index_write, queue_index_read]).
-define(COUNT_TIME, [io_sync, io_seek]).
-define(COUNT_TIME, [io_sync, io_seek, io_file_handle_open_attempt]).
-define(COUNT_TIME_BYTES, [io_read, io_write]).

init() ->
Expand Down
10 changes: 9 additions & 1 deletion src/rabbit_amqqueue_process.erl
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@
slave_pids,
synchronised_slave_pids,
recoverable_slaves,
state
state,
reductions,
garbage_collection
]).

-define(CREATION_EVENT_KEYS,
Expand Down Expand Up @@ -934,6 +936,12 @@ i(recoverable_slaves, #q{q = #amqqueue{name = Name,
end;
i(state, #q{status = running}) -> credit_flow:state();
i(state, #q{status = State}) -> State;
i(garbage_collection, _State) ->
{garbage_collection, GC} = erlang:process_info(self(), garbage_collection),
GC;
i(reductions, _State) ->
{reductions, Reductions} = erlang:process_info(self(), reductions),
Reductions;
i(Item, #q{backing_queue_state = BQS, backing_queue = BQ}) ->
BQ:info(Item, BQS).

Expand Down
2 changes: 1 addition & 1 deletion test/priority_queue_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ publish_payload(Ch, Q, PPds) ->
amqp_channel:wait_for_confirms(Ch).

publish_many(_Ch, _Q, 0) -> ok;
publish_many( Ch, Q, N) -> publish1(Ch, Q, rand_compat:uniform(5)),
publish_many( Ch, Q, N) -> publish1(Ch, Q, rand:uniform(5)),
publish_many(Ch, Q, N - 1).

publish1(Ch, Q, P) ->
Expand Down
2 changes: 1 addition & 1 deletion test/unit_inbroker_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1316,7 +1316,7 @@ maybe_switch_queue_mode(VQ) ->

random_queue_mode() ->
Modes = [lazy, default],
lists:nth(rand_compat:uniform(length(Modes)), Modes).
lists:nth(rand:uniform(length(Modes)), Modes).

pub_res({_, VQS}) ->
VQS;
Expand Down

0 comments on commit dc7f333

Please sign in to comment.