Kaynağa Gözat

Merge pull request #14318 from thalesmg/20241202-r584-fix-http-connector-state-init

fix(http action): correctly initialize resource state
Thales Macedo Garitezi 1 yıl önce
ebeveyn
işleme
55f960d529

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

@@ -1,6 +1,6 @@
 {application, emqx_bridge_http, [
     {description, "EMQX HTTP Bridge and Connector Application"},
-    {vsn, "0.3.5"},
+    {vsn, "0.3.6"},
     {registered, []},
     {applications, [kernel, stdlib, emqx_resource, ehttpc]},
     {env, [

+ 2 - 1
apps/emqx_bridge_http/src/emqx_bridge_http_connector.erl

@@ -236,7 +236,8 @@ on_start(
         port => Port,
         connect_timeout => ConnectTimeout,
         scheme => Scheme,
-        request => preprocess_request(maps:get(request, Config, undefined))
+        request => preprocess_request(maps:get(request, Config, undefined)),
+        installed_actions => #{}
     },
     case start_pool(InstId, PoolOpts) of
         ok ->

+ 7 - 0
changes/ce/fix-14318.en.md

@@ -0,0 +1,7 @@
+Fixed the initialization of the HTTP connector state.  When there was incoming traffic being handled by an HTTP action and its underlying connector restarted, cryptic crashes could be seen in the logs mentioning `function_clause`.
+
+Example:
+
+```
+20:42:36.850 [error] msg: "resource_exception", info: #{error => {error, function_clause}, id => <<"action:http:a:connector:http:a">>, name => call_query, ...
+```