|
@@ -211,7 +211,7 @@ ensure_client(ClientId, Hosts, ClientConfig) ->
|
|
|
case wolff_client_sup:find_client(ClientId) of
|
|
case wolff_client_sup:find_client(ClientId) of
|
|
|
{ok, _Pid} ->
|
|
{ok, _Pid} ->
|
|
|
ok;
|
|
ok;
|
|
|
- {error, no_such_client} ->
|
|
|
|
|
|
|
+ {error, #{reason := no_such_client}} ->
|
|
|
case wolff:ensure_supervised_client(ClientId, Hosts, ClientConfig) of
|
|
case wolff:ensure_supervised_client(ClientId, Hosts, ClientConfig) of
|
|
|
{ok, _} ->
|
|
{ok, _} ->
|
|
|
?SLOG(info, #{
|
|
?SLOG(info, #{
|
|
@@ -543,13 +543,13 @@ check_topic_and_leader_connections(ClientId, KafkaTopic, MaxPartitions) ->
|
|
|
{ok, Pid} ->
|
|
{ok, Pid} ->
|
|
|
ok = check_topic_status(ClientId, Pid, KafkaTopic),
|
|
ok = check_topic_status(ClientId, Pid, KafkaTopic),
|
|
|
ok = check_if_healthy_leaders(ClientId, Pid, KafkaTopic, MaxPartitions);
|
|
ok = check_if_healthy_leaders(ClientId, Pid, KafkaTopic, MaxPartitions);
|
|
|
- {error, no_such_client} ->
|
|
|
|
|
|
|
+ {error, #{reason := no_such_client}} ->
|
|
|
throw(#{
|
|
throw(#{
|
|
|
reason => cannot_find_kafka_client,
|
|
reason => cannot_find_kafka_client,
|
|
|
kafka_client => ClientId,
|
|
kafka_client => ClientId,
|
|
|
kafka_topic => KafkaTopic
|
|
kafka_topic => KafkaTopic
|
|
|
});
|
|
});
|
|
|
- {error, client_supervisor_not_initialized} ->
|
|
|
|
|
|
|
+ {error, #{reason := client_supervisor_not_initialized}} ->
|
|
|
throw(#{
|
|
throw(#{
|
|
|
reason => restarting,
|
|
reason => restarting,
|
|
|
kafka_client => ClientId,
|
|
kafka_client => ClientId,
|