Merge pull request #12359 from thalesmg/fix-connector-app-deps-r55-20240119

fix(machine_boot): inject connector/bridge apps as dependencies to `emqx_connector` app
This commit is contained in:
Thales Macedo Garitezi 2024-01-24 15:40:24 -03:00 committed by GitHub
commit a19cf253ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 16 additions and 18 deletions

View File

@ -10,8 +10,7 @@
{applications, [ {applications, [
kernel, kernel,
stdlib, stdlib,
emqx_resource, emqx_resource
emqx_connector
]}, ]},
{env, []}, {env, []},
{licenses, ["Business Source License 1.1"]}, {licenses, ["Business Source License 1.1"]},

View File

@ -2,7 +2,7 @@
{description, "EMQX HTTP Bridge and Connector Application"}, {description, "EMQX HTTP Bridge and Connector Application"},
{vsn, "0.2.2"}, {vsn, "0.2.2"},
{registered, []}, {registered, []},
{applications, [kernel, stdlib, emqx_connector, emqx_resource, ehttpc]}, {applications, [kernel, stdlib, emqx_resource, ehttpc]},
{env, [{emqx_action_info_modules, [emqx_bridge_http_action_info]}]}, {env, [{emqx_action_info_modules, [emqx_bridge_http_action_info]}]},
{modules, []}, {modules, []},
{links, []} {links, []}

View File

@ -10,9 +10,7 @@
{applications, [ {applications, [
kernel, kernel,
stdlib, stdlib,
emqx_resource, emqx_resource
%% for module emqx_connector_http
emqx_connector
]}, ]},
{env, []}, {env, []},
{licenses, ["Business Source License 1.1"]}, {licenses, ["Business Source License 1.1"]},

View File

@ -5,7 +5,6 @@
{applications, [ {applications, [
kernel, kernel,
stdlib, stdlib,
emqx_connector,
emqx_resource, emqx_resource,
emqx_mongodb emqx_mongodb
]}, ]},

View File

@ -5,7 +5,6 @@
{applications, [ {applications, [
kernel, kernel,
stdlib, stdlib,
emqx_connector,
emqx_resource, emqx_resource,
emqx_mysql emqx_mysql
]}, ]},

View File

@ -5,7 +5,6 @@
{applications, [ {applications, [
kernel, kernel,
stdlib, stdlib,
emqx_connector,
emqx_resource, emqx_resource,
emqx_redis emqx_redis
]}, ]},

View File

@ -178,6 +178,11 @@ app_deps(App, RebootApps) ->
%% `emqx_bridge' is special in that it needs all the bridges apps to %% `emqx_bridge' is special in that it needs all the bridges apps to
%% be started before it, so that, when it loads the bridges from %% be started before it, so that, when it loads the bridges from
%% configuration, the bridge app and its dependencies need to be up. %% configuration, the bridge app and its dependencies need to be up.
%%
%% `emqx_connector' also needs to start all connector dependencies for the same reason.
%% Since standalone apps like `emqx_mongodb' are already dependencies of `emqx_bridge_*'
%% apps, we may apply the same tactic for `emqx_connector' and inject individual bridges
%% as its dependencies.
inject_bridge_deps(RebootAppDeps) -> inject_bridge_deps(RebootAppDeps) ->
BridgeApps = [ BridgeApps = [
App App
@ -188,6 +193,8 @@ inject_bridge_deps(RebootAppDeps) ->
fun fun
({emqx_bridge, Deps0}) when is_list(Deps0) -> ({emqx_bridge, Deps0}) when is_list(Deps0) ->
{emqx_bridge, Deps0 ++ BridgeApps}; {emqx_bridge, Deps0 ++ BridgeApps};
({emqx_connector, Deps0}) when is_list(Deps0) ->
{emqx_connector, Deps0 ++ BridgeApps};
(App) -> (App) ->
App App
end, end,

View File

@ -392,7 +392,7 @@ t_create_webhook_v1_bridges_api({'init', Config}) ->
lists:foreach( lists:foreach(
fun(App) -> fun(App) ->
_ = application:stop(App), _ = application:stop(App),
{ok, [App]} = application:ensure_all_started(App) {ok, _} = application:ensure_all_started(App)
end, end,
[emqx_connector, emqx_bridge] [emqx_connector, emqx_bridge]
), ),

View File

@ -1,12 +1,11 @@
{application, emqx_mongodb, [ {application, emqx_mongodb, [
{description, "EMQX MongoDB Connector"}, {description, "EMQX MongoDB Connector"},
{vsn, "0.1.4"}, {vsn, "0.1.5"},
{registered, []}, {registered, []},
{applications, [ {applications, [
kernel, kernel,
stdlib, stdlib,
mongodb, mongodb,
emqx_connector,
emqx_resource emqx_resource
]}, ]},
{env, []}, {env, []},

View File

@ -1,12 +1,11 @@
{application, emqx_mysql, [ {application, emqx_mysql, [
{description, "EMQX MySQL Database Connector"}, {description, "EMQX MySQL Database Connector"},
{vsn, "0.1.6"}, {vsn, "0.1.7"},
{registered, []}, {registered, []},
{applications, [ {applications, [
kernel, kernel,
stdlib, stdlib,
mysql, mysql,
emqx_connector,
emqx_resource emqx_resource
]}, ]},
{env, []}, {env, []},

View File

@ -1,12 +1,11 @@
{application, emqx_postgresql, [ {application, emqx_postgresql, [
{description, "EMQX PostgreSQL Database Connector"}, {description, "EMQX PostgreSQL Database Connector"},
{vsn, "0.1.1"}, {vsn, "0.1.2"},
{registered, []}, {registered, []},
{applications, [ {applications, [
kernel, kernel,
stdlib, stdlib,
epgsql, epgsql,
emqx_connector,
emqx_resource emqx_resource
]}, ]},
{env, []}, {env, []},

View File

@ -1,13 +1,12 @@
{application, emqx_redis, [ {application, emqx_redis, [
{description, "EMQX Redis Database Connector"}, {description, "EMQX Redis Database Connector"},
{vsn, "0.1.4"}, {vsn, "0.1.5"},
{registered, []}, {registered, []},
{applications, [ {applications, [
kernel, kernel,
stdlib, stdlib,
eredis, eredis,
eredis_cluster, eredis_cluster,
emqx_connector,
emqx_resource emqx_resource
]}, ]},
{env, []}, {env, []},

View File

@ -0,0 +1 @@
Fixed an issue that could lead to error messages when restarting a node configured with some types of data bridges. Said bridges could also start in a failed state, requiring manual restart.