Fix some OTP-27 Dialyzer errors in rabbitmq_peer_discovery_etcd

And disable those checks in CI for now. We are getting errors
because of the eetcd dependency and we can't upgrade at this
time (see comment in the commit).
This commit is contained in:
Loïc Hoguin 2024-09-17 13:13:34 +02:00
parent 67eee5602c
commit b8723d6cd2
No known key found for this signature in database
GPG Key ID: C69E26E3A9DF618F
2 changed files with 8 additions and 4 deletions

View File

@ -42,7 +42,11 @@ jobs:
- rabbitmq_management_agent
- rabbitmq_peer_discovery_common
- rabbitmq_peer_discovery_consul
- rabbitmq_peer_discovery_etcd
# @todo We are getting errors because of wrong types
# in the eetcd dep. But upgrading requires using gun 2.0,
# which we can't because another app's dep, emqtt, requires
# gun 1.3.x. So for now we don't type check this plugin.
#- rabbitmq_peer_discovery_etcd
- rabbitmq_peer_discovery_k8s
- rabbitmq_prelaunch
- rabbitmq_prometheus

View File

@ -87,7 +87,7 @@ callback_mode() -> [state_functions, state_enter].
terminate(Reason, State, Data) ->
rabbit_log:debug("etcd v3 API client will terminate in state ~tp, reason: ~tp",
[State, Reason]),
disconnect(?ETCD_CONN_NAME, Data),
_ = disconnect(?ETCD_CONN_NAME, Data),
rabbit_log:debug("etcd v3 API client has disconnected"),
rabbit_log:debug("etcd v3 API client: total number of connections to etcd is ~tp", [length(eetcd_conn_sup:info())]),
ok.
@ -157,13 +157,13 @@ recover(internal, start, Data = #statem_data{endpoints = Endpoints, connection_m
}};
{error, Errors} ->
[rabbit_log:error("etcd peer discovery: failed to connect to endpoint ~tp: ~tp", [Endpoint, Err]) || {Endpoint, Err} <- Errors],
ensure_disconnected(?ETCD_CONN_NAME, Data),
_ = ensure_disconnected(?ETCD_CONN_NAME, Data),
Actions = [{state_timeout, reconnection_interval(), recover}],
{keep_state, reset_statem_data(Data), Actions}
end;
recover(state_timeout, _PrevState, Data) ->
rabbit_log:debug("etcd peer discovery: connection entered a reconnection delay state"),
ensure_disconnected(?ETCD_CONN_NAME, Data),
_ = ensure_disconnected(?ETCD_CONN_NAME, Data),
{next_state, recover, reset_statem_data(Data)};
recover({call, From}, Req, _Data) ->
rabbit_log:error("etcd v3 API: client received a call ~tp while not connected, will do nothing", [Req]),