Skip to content
This repository has been archived by the owner on Nov 17, 2020. It is now read-only.

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 Jun 29, 2016
2 parents 0ba62eb + f846d9c commit c082ad9
Show file tree
Hide file tree
Showing 59 changed files with 3,118 additions and 1,959 deletions.
23 changes: 12 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@
.sw?
.*.sw?
*.beam
.erlang.mk/
cover/
deps/
doc/
ebin/
logs/
plugins/
/.erlang.mk/
/cover/
/deps/
/doc/
/ebin/
/logs/
/plugins/
/xrefr

rabbit_common.d
/rabbit_common.d

# Generated source files.
include/rabbit_framing.hrl
src/rabbit_framing_amqp_0_8.erl
src/rabbit_framing_amqp_0_9_1.erl
/include/rabbit_framing.hrl
/src/rabbit_framing_amqp_0_8.erl
/src/rabbit_framing_amqp_0_9_1.erl
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ addons:
packages:
- xsltproc
otp_release:
- "R16B03-1"
- "17.5"
- "18.2"
- "18.3"

# 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
Expand Down
44 changes: 44 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Contributor Code of Conduct

As contributors and maintainers of this project, and in the interest of fostering an open
and welcoming community, we pledge to respect all people who contribute through reporting
issues, posting feature requests, updating documentation, submitting pull requests or
patches, and other activities.

We are committed to making participation in this project a harassment-free experience for
everyone, regardless of level of experience, gender, gender identity and expression,
sexual orientation, disability, personal appearance, body size, race, ethnicity, age,
religion, or nationality.

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery
* Personal attacks
* Trolling or insulting/derogatory comments
* Public or private harassment
* Publishing other's private information, such as physical or electronic addresses,
without explicit permission
* Other unethical or unprofessional conduct

Project maintainers have the right and responsibility to remove, edit, or reject comments,
commits, code, wiki edits, issues, and other contributions that are not aligned to this
Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors
that they deem inappropriate, threatening, offensive, or harmful.

By adopting this Code of Conduct, project maintainers commit themselves to fairly and
consistently applying these principles to every aspect of managing this project. Project
maintainers who do not follow or enforce the Code of Conduct may be permanently removed
from the project team.

This Code of Conduct applies both within project spaces and in public spaces when an
individual is representing the project or its community.

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by
contacting a project maintainer at [[email protected]](mailto:[email protected]). All complaints will
be reviewed and investigated and will result in a response that is deemed necessary and
appropriate to the circumstances. Maintainers are obligated to maintain confidentiality
with regard to the reporter of an incident.

This Code of Conduct is adapted from the
[Contributor Covenant](http://contributor-covenant.org), version 1.3.0, available at
[contributor-covenant.org/version/1/3/0/](http://contributor-covenant.org/version/1/3/0/)
38 changes: 38 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
## Overview

RabbitMQ projects use pull requests to discuss, collaborate on and accept code contributions.
Pull requests is the primary place of discussing code changes.

## How to Contribute

The process is fairly standard:

* Fork the repository or repositories you plan on contributing to
* Clone [RabbitMQ umbrella repository](https://github.com/rabbitmq/rabbitmq-public-umbrella)
* `cd umbrella`, `make co`
* Create a branch with a descriptive name in the relevant repositories
* Make your changes, run tests, commit with a [descriptive message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html), push to your fork
* Submit pull requests with an explanation what has been changed and **why**
* Submit a filled out and signed [Contributor Agreement](https://github.com/rabbitmq/ca#how-to-submit) if needed (see below)
* Be patient. We will get to your pull request eventually

If what you are going to work on is a substantial change, please first ask the core team
of their opinion on [RabbitMQ mailing list](https://groups.google.com/forum/#!forum/rabbitmq-users).


## Code of Conduct

See [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md).


## Contributor Agreement

If you want to contribute a non-trivial change, please submit a signed copy of our
[Contributor Agreement](https://github.com/rabbitmq/ca#how-to-submit) around the time
you submit your pull request. This will make it much easier (in some cases, possible)
for the RabbitMQ team at Pivotal to merge your contribution.


## Where to Ask Questions

If something isn't clear, feel free to ask on our [mailing list](https://groups.google.com/forum/#!forum/rabbitmq-users).
54 changes: 25 additions & 29 deletions codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def prettyType(typeName, subTypes, typesPerLine = 4):
sTs = multiLineFormat(subTypes,
"( ", " | ", "\n | ", " )",
thingsPerLine = typesPerLine)
return "-type(%s ::\n %s)." % (typeName, sTs)
return "-type %s ::\n %s." % (typeName, sTs)

def printFileHeader():
print("""%% Autogenerated code. Do not edit.
Expand Down Expand Up @@ -348,26 +348,25 @@ def genAmqpException(c,v,cls):
""")
print("%% Various types")
print("-ifdef(use_specs).")

print("""-export_type([amqp_field_type/0, amqp_property_type/0,
amqp_table/0, amqp_array/0, amqp_value/0,
amqp_method_name/0, amqp_method/0, amqp_method_record/0,
amqp_method_field_name/0, amqp_property_record/0,
amqp_exception/0, amqp_exception_code/0, amqp_class_id/0]).
-type(amqp_field_type() ::
-type amqp_field_type() ::
'longstr' | 'signedint' | 'decimal' | 'timestamp' |
'unsignedbyte' | 'unsignedshort' | 'unsignedint' |
'table' | 'byte' | 'double' | 'float' | 'long' |
'short' | 'bool' | 'binary' | 'void' | 'array').
-type(amqp_property_type() ::
'short' | 'bool' | 'binary' | 'void' | 'array'.
-type amqp_property_type() ::
'shortstr' | 'longstr' | 'octet' | 'short' | 'long' |
'longlong' | 'timestamp' | 'bit' | 'table').
'longlong' | 'timestamp' | 'bit' | 'table'.
-type(amqp_table() :: [{binary(), amqp_field_type(), amqp_value()}]).
-type(amqp_array() :: [{amqp_field_type(), amqp_value()}]).
-type(amqp_value() :: binary() | % longstr
-type amqp_table() :: [{binary(), amqp_field_type(), amqp_value()}].
-type amqp_array() :: [{amqp_field_type(), amqp_value()}].
-type amqp_value() :: binary() | % longstr
integer() | % signedint
{non_neg_integer(), non_neg_integer()} | % decimal
amqp_table() |
Expand All @@ -379,8 +378,7 @@ def genAmqpException(c,v,cls):
boolean() | % bool
binary() | % binary
'undefined' | % void
non_neg_integer() % timestamp
).
non_neg_integer(). % timestamp
""")

print(prettyType("amqp_method_name()",
Expand Down Expand Up @@ -410,27 +408,25 @@ def genAmqpException(c,v,cls):
["%i" % ci for ci in classIds]))
print(prettyType("amqp_class_name()",
["%s" % c.erlangName() for c in spec.allClasses()]))
print("-endif. % use_specs")

print("""
%% Method signatures
-ifdef(use_specs).
-spec(version/0 :: () -> {non_neg_integer(), non_neg_integer(), non_neg_integer()}).
-spec(lookup_method_name/1 :: (amqp_method()) -> amqp_method_name()).
-spec(lookup_class_name/1 :: (amqp_class_id()) -> amqp_class_name()).
-spec(method_id/1 :: (amqp_method_name()) -> amqp_method()).
-spec(method_has_content/1 :: (amqp_method_name()) -> boolean()).
-spec(is_method_synchronous/1 :: (amqp_method_record()) -> boolean()).
-spec(method_record/1 :: (amqp_method_name()) -> amqp_method_record()).
-spec(method_fieldnames/1 :: (amqp_method_name()) -> [amqp_method_field_name()]).
-spec(decode_method_fields/2 ::
(amqp_method_name(), binary()) -> amqp_method_record() | rabbit_types:connection_exit()).
-spec(decode_properties/2 :: (non_neg_integer(), binary()) -> amqp_property_record()).
-spec(encode_method_fields/1 :: (amqp_method_record()) -> binary()).
-spec(encode_properties/1 :: (amqp_property_record()) -> binary()).
-spec(lookup_amqp_exception/1 :: (amqp_exception()) -> {boolean(), amqp_exception_code(), binary()}).
-spec(amqp_exception/1 :: (amqp_exception_code()) -> amqp_exception()).
-endif. % use_specs
-spec version() -> {non_neg_integer(), non_neg_integer(), non_neg_integer()}.
-spec lookup_method_name(amqp_method()) -> amqp_method_name().
-spec lookup_class_name(amqp_class_id()) -> amqp_class_name().
-spec method_id(amqp_method_name()) -> amqp_method().
-spec method_has_content(amqp_method_name()) -> boolean().
-spec is_method_synchronous(amqp_method_record()) -> boolean().
-spec method_record(amqp_method_name()) -> amqp_method_record().
-spec method_fieldnames(amqp_method_name()) -> [amqp_method_field_name()].
-spec decode_method_fields(amqp_method_name(), binary()) ->
amqp_method_record() | rabbit_types:connection_exit().
-spec decode_properties(non_neg_integer(), binary()) -> amqp_property_record().
-spec encode_method_fields(amqp_method_record()) -> binary().
-spec encode_properties(amqp_property_record()) -> binary().
-spec lookup_amqp_exception(amqp_exception()) ->
{boolean(), amqp_exception_code(), binary()}.
-spec amqp_exception(amqp_exception_code()) -> amqp_exception().
bitvalue(true) -> 1;
bitvalue(false) -> 0;
Expand Down
33 changes: 23 additions & 10 deletions include/rabbit.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@
policy, %% durable, implicit update as above
gm_pids, %% transient
decorators, %% transient, recalculated as above
state}). %% durable (have we crashed?)
state, %% durable (have we crashed?)
policy_version,
slave_pids_pending_shutdown}).

-record(exchange_serial, {name, next}).

Expand All @@ -108,7 +110,7 @@
-record(trie_edge, {exchange_name, node_id, word}).
-record(trie_binding, {exchange_name, node_id, destination, arguments}).

-record(listener, {node, protocol, host, ip_address, port}).
-record(listener, {node, protocol, host, ip_address, port, opts = []}).

-record(runtime_parameters, {key, value}).

Expand All @@ -133,12 +135,21 @@

-record(message_properties, {expiry, needs_confirming = false, size}).

-record(plugin, {name, %% atom()
version, %% string()
description, %% string()
type, %% 'ez' or 'dir'
dependencies, %% [{atom(), string()}]
location}). %% string()
-record(plugin, {name, %% atom()
version, %% string()
description, %% string()
type, %% 'ez' or 'dir'
dependencies, %% [{atom(), string()}]
location, %% string()
%% List of supported broker version ranges,
%% e.g. ["3.5.7", "3.6.1"]
broker_version_requirements, %% [string()]
%% Proplist of supported dependency versions,
%% e.g. [{rabbitmq_management, ["3.5.7", "3.6.1"]},
%% {rabbitmq_federation, ["3.5.7", "3.6.1"]},
%% {rabbitmq_email, ["0.1.0"]}]
dependency_version_requirements %% [{atom(), [string()]}]
}).

%% used to track connections across virtual hosts
%% so that limits can be enforced
Expand Down Expand Up @@ -168,8 +179,8 @@

-define(COPYRIGHT_MESSAGE, "Copyright (C) 2007-2016 Pivotal Software, Inc.").
-define(INFORMATION_MESSAGE, "Licensed under the MPL. See http://www.rabbitmq.com/").
-define(OTP_MINIMUM, "R16B03").
-define(ERTS_MINIMUM, "5.10.4").
-define(OTP_MINIMUM, "18.3").
-define(ERTS_MINIMUM, "7.3").

%% EMPTY_FRAME_SIZE, 8 = 1 + 2 + 4 + 1
%% - 1 byte of frame type
Expand All @@ -181,6 +192,8 @@
-define(EMPTY_FRAME_SIZE, 8).

-define(MAX_WAIT, 16#ffffffff).
-define(SUPERVISOR_WAIT, infinity).
-define(WORKER_WAIT, 30000).

-define(HIBERNATE_AFTER_MIN, 1000).
-define(DESIRED_HIBERNATE, 10000).
Expand Down
4 changes: 0 additions & 4 deletions include/rabbit_msg_store.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@

-include("rabbit.hrl").

-ifdef(use_specs).

-type(msg() :: any()).

-endif.

-record(msg_location, {msg_id, ref_count, file, offset, total_size}).
21 changes: 16 additions & 5 deletions mk/rabbitmq-build.mk
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
# FIXME: We copy Erlang.mk default flags here: rabbitmq-build.mk is
# loaded as a plugin, so before those variables are defined. And because
# Erlang.mk uses '?=', the flags we set here override the default set.

WARNING_OPTS += +debug_info \
+warn_export_vars \
+warn_shadow_vars \
+warn_obsolete_guard
ERLC_OPTS += -Werror $(WARNING_OPTS)
TEST_ERLC_OPTS += $(WARNING_OPTS)

# Add Lager parse_transform module and our default Lager extra sinks.
LAGER_EXTRA_SINKS += rabbit_log \
rabbit_channel \
rabbit_connection \
rabbit_mirroring \
rabbit_queue \
rabbit_federation
rabbit_log_channel \
rabbit_log_connection \
rabbit_log_mirroring \
rabbit_log_queue \
rabbit_log_federation
lager_extra_sinks = $(subst $(space),$(comma),$(LAGER_EXTRA_SINKS))

RMQ_ERLC_OPTS += +'{parse_transform,lager_transform}' \
Expand Down
8 changes: 8 additions & 0 deletions mk/rabbitmq-components.mk
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ dep_rabbitmq_event_exchange = git_rmq rabbitmq-event-exchange $(curren
dep_rabbitmq_federation = git_rmq rabbitmq-federation $(current_rmq_ref) $(base_rmq_ref) master
dep_rabbitmq_federation_management = git_rmq rabbitmq-federation-management $(current_rmq_ref) $(base_rmq_ref) master
dep_rabbitmq_java_client = git_rmq rabbitmq-java-client $(current_rmq_ref) $(base_rmq_ref) master
dep_rabbitmq_jms_topic_exchange = git_rmq rabbitmq-jms-topic-exchange $(current_rmq_ref) $(base_rmq_ref) master
dep_rabbitmq_lvc = git_rmq rabbitmq-lvc-plugin $(current_rmq_ref) $(base_rmq_ref) master
dep_rabbitmq_management = git_rmq rabbitmq-management $(current_rmq_ref) $(base_rmq_ref) master
dep_rabbitmq_management_agent = git_rmq rabbitmq-management-agent $(current_rmq_ref) $(base_rmq_ref) master
Expand All @@ -53,7 +54,9 @@ dep_rabbitmq_management_visualiser = git_rmq rabbitmq-management-visualiser $
dep_rabbitmq_message_timestamp = git_rmq rabbitmq-message-timestamp $(current_rmq_ref) $(base_rmq_ref) master
dep_rabbitmq_metronome = git_rmq rabbitmq-metronome $(current_rmq_ref) $(base_rmq_ref) master
dep_rabbitmq_mqtt = git_rmq rabbitmq-mqtt $(current_rmq_ref) $(base_rmq_ref) master
dep_rabbitmq_objc_client = git_rmq rabbitmq-objc-client $(current_rmq_ref) $(base_rmq_ref) master
dep_rabbitmq_recent_history_exchange = git_rmq rabbitmq-recent-history-exchange $(current_rmq_ref) $(base_rmq_ref) master
dep_rabbitmq_routing_node_stamp = git_rmq rabbitmq-routing-node-stamp $(current_rmq_ref) $(base_rmq_ref) master
dep_rabbitmq_rtopic_exchange = git_rmq rabbitmq-rtopic-exchange $(current_rmq_ref) $(base_rmq_ref) master
dep_rabbitmq_sharding = git_rmq rabbitmq-sharding $(current_rmq_ref) $(base_rmq_ref) master
dep_rabbitmq_shovel = git_rmq rabbitmq-shovel $(current_rmq_ref) $(base_rmq_ref) master
Expand All @@ -62,6 +65,7 @@ dep_rabbitmq_stomp = git_rmq rabbitmq-stomp $(current_rmq_ref
dep_rabbitmq_toke = git_rmq rabbitmq-toke $(current_rmq_ref) $(base_rmq_ref) master
dep_rabbitmq_top = git_rmq rabbitmq-top $(current_rmq_ref) $(base_rmq_ref) master
dep_rabbitmq_tracing = git_rmq rabbitmq-tracing $(current_rmq_ref) $(base_rmq_ref) master
dep_rabbitmq_trust_store = git_rmq rabbitmq-trust-store $(current_rmq_ref) $(base_rmq_ref) master
dep_rabbitmq_test = git_rmq rabbitmq-test $(current_rmq_ref) $(base_rmq_ref) master
dep_rabbitmq_web_dispatch = git_rmq rabbitmq-web-dispatch $(current_rmq_ref) $(base_rmq_ref) master
dep_rabbitmq_web_stomp = git_rmq rabbitmq-web-stomp $(current_rmq_ref) $(base_rmq_ref) master
Expand Down Expand Up @@ -99,6 +103,7 @@ RABBITMQ_COMPONENTS = amqp_client \
rabbitmq_federation \
rabbitmq_federation_management \
rabbitmq_java_client \
rabbitmq_jms_topic_exchange \
rabbitmq_lvc \
rabbitmq_management \
rabbitmq_management_agent \
Expand All @@ -108,7 +113,9 @@ RABBITMQ_COMPONENTS = amqp_client \
rabbitmq_message_timestamp \
rabbitmq_metronome \
rabbitmq_mqtt \
rabbitmq_objc_client \
rabbitmq_recent_history_exchange \
rabbitmq_routing_node_stamp \
rabbitmq_rtopic_exchange \
rabbitmq_sharding \
rabbitmq_shovel \
Expand All @@ -118,6 +125,7 @@ RABBITMQ_COMPONENTS = amqp_client \
rabbitmq_toke \
rabbitmq_top \
rabbitmq_tracing \
rabbitmq_trust_store \
rabbitmq_web_dispatch \
rabbitmq_web_mqtt \
rabbitmq_web_mqtt_examples \
Expand Down
Loading

0 comments on commit c082ad9

Please sign in to comment.