Merge pull request #8100 from rabbitmq/otp26-dialyzer

This commit is contained in:
Michael Klishin 2023-05-04 19:05:23 +04:00 committed by GitHub
commit bbb98226e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 30 additions and 27 deletions

View File

@ -172,8 +172,8 @@ erlang_package.hex_package(
erlang_package.hex_package(
name = "credentials_obfuscation",
build_file = "@rabbitmq-server//bazel:BUILD.credentials_obfuscation",
sha256 = "fe8ece91a1ba6c8a08eb1063cfd5b063a723c5fe29a1fad6b7cbd76cb18d2eeb",
version = "3.2.0",
sha256 = "738ace0ed5545d2710d3f7383906fc6f6b582d019036e5269c4dbd85dbced566",
version = "3.4.0",
)
erlang_package.hex_package(

View File

@ -24,16 +24,9 @@ erlang_bytecode(
"src/credentials_obfuscation_sup.erl",
"src/credentials_obfuscation_svc.erl",
],
outs = [
"ebin/credentials_obfuscation.beam",
"ebin/credentials_obfuscation_app.beam",
"ebin/credentials_obfuscation_pbe.beam",
"ebin/credentials_obfuscation_sup.beam",
"ebin/credentials_obfuscation_svc.beam",
],
hdrs = ["include/credentials_obfuscation.hrl"],
hdrs = [":public_and_private_hdrs"],
app_name = "credentials_obfuscation",
beam = [],
dest = "ebin",
erlc_opts = "//:erlc_opts",
)
@ -54,20 +47,17 @@ filegroup(
],
)
filegroup(
name = "private_hdrs",
srcs = [],
)
filegroup(name = "private_hdrs")
filegroup(
name = "public_hdrs",
srcs = ["include/credentials_obfuscation.hrl"],
srcs = [
"include/credentials_obfuscation.hrl",
"include/otp_crypto.hrl",
],
)
filegroup(
name = "priv",
srcs = [],
)
filegroup(name = "priv")
filegroup(
name = "licenses",
@ -101,6 +91,8 @@ erlang_app(
app_name = "credentials_obfuscation",
beam_files = [":beam_files"],
extra_apps = ["crypto"],
license_files = [":license_files"],
priv = [":priv"],
)
alias(
@ -108,3 +100,12 @@ alias(
actual = ":erlang_app",
visibility = ["//visibility:public"],
)
filegroup(
name = "license_files",
srcs = [
"LICENSE",
"LICENSE-APACHE2",
"LICENSE-MPL-RabbitMQ",
],
)

View File

@ -237,6 +237,7 @@ plt(
name = "deps_plt",
apps = [
"mnesia", # keep
"runtime_tools",
],
for_target = ":erlang_app",
ignore_warnings = True,

View File

@ -17,7 +17,7 @@
is_list(H) orelse
(is_map(H) andalso is_map_key(size, H))).
-type tuple(A, B) :: nonempty_improper_list(A, B).
-type optimised_tuple(A, B) :: nonempty_improper_list(A, B).
-type option(T) :: undefined | T.
@ -35,7 +35,7 @@
%% same process
-type msg_header() :: msg_size() |
tuple(msg_size(), Expiry :: milliseconds()) |
optimised_tuple(msg_size(), Expiry :: milliseconds()) |
#{size := msg_size(),
delivery_count => non_neg_integer(),
expiry => milliseconds()}.
@ -51,7 +51,7 @@
-type msg_size() :: non_neg_integer().
%% the size in bytes of the msg payload
-type msg() :: tuple(option(ra:index()), msg_header()).
-type msg() :: optimised_tuple(option(ra:index()), msg_header()).
-type delivery_msg() :: {msg_id(), {msg_header(), raw_msg()}}.
%% A tuple consisting of the message id, and the headered message.

View File

@ -7,13 +7,13 @@
-record(dlx_consumer,
{pid :: pid(),
prefetch :: non_neg_integer(),
checked_out = #{} :: #{msg_id() => tuple(rabbit_dead_letter:reason(), msg())},
checked_out = #{} :: #{msg_id() => optimised_tuple(rabbit_dead_letter:reason(), msg())},
next_msg_id = 0 :: msg_id()}).
-record(rabbit_fifo_dlx,
{consumer :: option(#dlx_consumer{}),
%% Queue of dead-lettered messages.
discards = lqueue:new() :: lqueue:lqueue(tuple(rabbit_dead_letter:reason(), msg())),
discards = lqueue:new() :: lqueue:lqueue(optimised_tuple(rabbit_dead_letter:reason(), msg())),
%% Raft indexes of messages in both discards queue and dlx_consumer's checked_out map
%% so that we get the smallest ra index in O(1).
ra_indexes = rabbit_fifo_index:empty() :: rabbit_fifo_index:state(),

View File

@ -22,7 +22,7 @@
%%----------------------------------------------------------------------------
-spec start(rabbit_types:vhost()) -> rabbit_types:ok_or_error2(term()).
-spec start(rabbit_types:vhost()) -> rabbit_types:ok_or_error2(pid(), {no_such_vhost, rabbit_types:vhost()}).
start(VHost) ->
case rabbit_vhost_sup_sup:get_vhost_sup(VHost) of
@ -37,7 +37,8 @@ start(VHost) ->
%% e.g. some integration tests do it
{error, {no_such_vhost, VHost}} ->
rabbit_log:error("Failed to start a recovery terms manager for vhost ~ts: vhost no longer exists!",
[VHost])
[VHost]),
{error, {no_such_vhost, VHost}}
end.
-spec stop(rabbit_types:vhost()) -> rabbit_types:ok_or_error(term()).