Преглед на файлове

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.
Thales Macedo Garitezi преди 2 години
родител
ревизия
ebecbd1545

+ 1 - 1
apps/emqx_bridge_gcp_pubsub/src/emqx_bridge_gcp_pubsub.app.src

@@ -1,6 +1,6 @@
 {application, emqx_bridge_gcp_pubsub, [
     {description, "EMQX Enterprise GCP Pub/Sub Bridge"},
-    {vsn, "0.1.6"},
+    {vsn, "0.1.7"},
     {registered, []},
     {applications, [
         kernel,

+ 4 - 1
apps/emqx_bridge_gcp_pubsub/src/emqx_bridge_gcp_pubsub.erl

@@ -191,7 +191,10 @@ fields(consumer_topic_mapping) ->
             )}
     ];
 fields("consumer_resource_opts") ->
-    ResourceFields = emqx_resource_schema:fields("creation_opts"),
+    ResourceFields =
+        emqx_resource_schema:create_opts(
+            [{health_check_interval, #{default => <<"30s">>}}]
+        ),
     SupportedFields = [
         auto_restart_interval,
         health_check_interval,

+ 1 - 1
apps/emqx_resource/src/emqx_resource.app.src

@@ -1,7 +1,7 @@
 %% -*- mode: erlang -*-
 {application, emqx_resource, [
     {description, "Manager for all external resources"},
-    {vsn, "0.1.21"},
+    {vsn, "0.1.22"},
     {registered, []},
     {mod, {emqx_resource_app, []}},
     {applications, [

+ 3 - 1
apps/emqx_resource/src/emqx_resource_manager.erl

@@ -179,7 +179,9 @@ create_dry_run(ResourceType, Config) ->
             false -> #{}
         end,
     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 ->
             remove(ResId);
         {error, Reason} ->

+ 1 - 0
apps/emqx_resource/src/schema/emqx_resource_schema.erl

@@ -47,6 +47,7 @@ fields("resource_opts") ->
 fields("creation_opts") ->
     create_opts([]).
 
+-spec create_opts([{atom(), hocon_schema:field_schema_map()}]) -> [{atom(), hocon_schema:field()}].
 create_opts(Overrides) ->
     override(
         [

+ 1 - 0
changes/ee/fix-11461.en.md

@@ -0,0 +1 @@
+Made the timeout for testing bridges connectivity follow more closely the configured health check timeout.