Merge pull request #9837 from zmstone/0123-fix-resource-worker-leak-influxdb

0123 fix resource worker leak influxdb
This commit is contained in:
Zaiming (Stone) Shi 2023-01-26 09:14:38 +01:00 committed by GitHub
commit bafc430184
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

4
build
View File

@ -332,13 +332,15 @@ make_docker() {
if [[ "$PROFILE" = *-elixir ]]; then if [[ "$PROFILE" = *-elixir ]]; then
PKG_VSN="$PKG_VSN-elixir" PKG_VSN="$PKG_VSN-elixir"
fi fi
local default_tag="emqx/${PROFILE%%-elixir}:${PKG_VSN}"
EMQX_IMAGE_TAG="${EMQX_IMAGE_TAG:-$default_tag}"
set -x set -x
docker build --no-cache --pull \ docker build --no-cache --pull \
--build-arg BUILD_FROM="${EMQX_BUILDER}" \ --build-arg BUILD_FROM="${EMQX_BUILDER}" \
--build-arg RUN_FROM="${EMQX_RUNNER}" \ --build-arg RUN_FROM="${EMQX_RUNNER}" \
--build-arg EMQX_NAME="$PROFILE" \ --build-arg EMQX_NAME="$PROFILE" \
--tag "emqx/${PROFILE%%-elixir}:${PKG_VSN}" \ --tag "${EMQX_IMAGE_TAG}" \
-f "${EMQX_DOCKERFILE}" . -f "${EMQX_DOCKERFILE}" .
} }

View File

@ -248,6 +248,8 @@ do_start_client(
client => Client, client => Client,
reason => "client is not alive" reason => "client is not alive"
}), }),
%% no leak
_ = influxdb:stop_client(Client),
{error, influxdb_client_not_alive} {error, influxdb_client_not_alive}
end; end;
{error, {already_started, Client0}} -> {error, {already_started, Client0}} ->