fix(bridge): make dryrun health check timeout more malleable
Fixes https://emqx.atlassian.net/browse/EMQX-10773 - Makes the timeout for probing a bridge more malleable to account for differences between each database. - Increases GCP PubSub Consumer default health check timeout to account for GCP slowness/throttling.
This commit is contained in:
parent
c60751b401
commit
ebecbd1545
|
@ -1,6 +1,6 @@
|
||||||
{application, emqx_bridge_gcp_pubsub, [
|
{application, emqx_bridge_gcp_pubsub, [
|
||||||
{description, "EMQX Enterprise GCP Pub/Sub Bridge"},
|
{description, "EMQX Enterprise GCP Pub/Sub Bridge"},
|
||||||
{vsn, "0.1.6"},
|
{vsn, "0.1.7"},
|
||||||
{registered, []},
|
{registered, []},
|
||||||
{applications, [
|
{applications, [
|
||||||
kernel,
|
kernel,
|
||||||
|
|
|
@ -191,7 +191,10 @@ fields(consumer_topic_mapping) ->
|
||||||
)}
|
)}
|
||||||
];
|
];
|
||||||
fields("consumer_resource_opts") ->
|
fields("consumer_resource_opts") ->
|
||||||
ResourceFields = emqx_resource_schema:fields("creation_opts"),
|
ResourceFields =
|
||||||
|
emqx_resource_schema:create_opts(
|
||||||
|
[{health_check_interval, #{default => <<"30s">>}}]
|
||||||
|
),
|
||||||
SupportedFields = [
|
SupportedFields = [
|
||||||
auto_restart_interval,
|
auto_restart_interval,
|
||||||
health_check_interval,
|
health_check_interval,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
%% -*- mode: erlang -*-
|
%% -*- mode: erlang -*-
|
||||||
{application, emqx_resource, [
|
{application, emqx_resource, [
|
||||||
{description, "Manager for all external resources"},
|
{description, "Manager for all external resources"},
|
||||||
{vsn, "0.1.21"},
|
{vsn, "0.1.22"},
|
||||||
{registered, []},
|
{registered, []},
|
||||||
{mod, {emqx_resource_app, []}},
|
{mod, {emqx_resource_app, []}},
|
||||||
{applications, [
|
{applications, [
|
||||||
|
|
|
@ -179,7 +179,9 @@ create_dry_run(ResourceType, Config) ->
|
||||||
false -> #{}
|
false -> #{}
|
||||||
end,
|
end,
|
||||||
ok = emqx_resource_manager_sup:ensure_child(ResId, <<"dry_run">>, ResourceType, Config, Opts),
|
ok = emqx_resource_manager_sup:ensure_child(ResId, <<"dry_run">>, ResourceType, Config, Opts),
|
||||||
case wait_for_ready(ResId, 5000) of
|
HealthCheckInterval = maps:get(health_check_interval, Opts, ?HEALTHCHECK_INTERVAL),
|
||||||
|
Timeout = emqx_utils:clamp(HealthCheckInterval, 5_000, 60_000),
|
||||||
|
case wait_for_ready(ResId, Timeout) of
|
||||||
ok ->
|
ok ->
|
||||||
remove(ResId);
|
remove(ResId);
|
||||||
{error, Reason} ->
|
{error, Reason} ->
|
||||||
|
|
|
@ -47,6 +47,7 @@ fields("resource_opts") ->
|
||||||
fields("creation_opts") ->
|
fields("creation_opts") ->
|
||||||
create_opts([]).
|
create_opts([]).
|
||||||
|
|
||||||
|
-spec create_opts([{atom(), hocon_schema:field_schema_map()}]) -> [{atom(), hocon_schema:field()}].
|
||||||
create_opts(Overrides) ->
|
create_opts(Overrides) ->
|
||||||
override(
|
override(
|
||||||
[
|
[
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Made the timeout for testing bridges connectivity follow more closely the configured health check timeout.
|
Loading…
Reference in New Issue