fix(ft-s3): rely on asynchronous upload abort

So that upload aborts would not block assemblers. This should not
affect the expected behavior since S3 API usually allows having
concurrent uploads, plus we couldn't really guarantee successful aborts
anyway.
This commit is contained in:
Andrew Mayorov 2023-05-25 19:18:16 +03:00
parent cc3275b389
commit 3d428a2e0e
No known key found for this signature in database
GPG Key ID: 2837C62ACFBFED5D
2 changed files with 10 additions and 2 deletions

View File

@ -94,7 +94,8 @@ complete(#{pid := Pid} = _ExportSt, _Checksum) ->
-spec discard(export_st()) ->
ok.
discard(#{pid := Pid} = _ExportSt) ->
emqx_s3_uploader:abort(Pid).
% NOTE: will abort upload asynchronously if needed
emqx_s3_uploader:shutdown(Pid).
-spec list(options(), query()) ->
{ok, page(exportinfo())} | {error, term()}.

View File

@ -18,7 +18,9 @@
complete/2,
abort/1,
abort/2
abort/2,
shutdown/1
]).
-export([
@ -87,6 +89,11 @@ abort(Pid) ->
abort(Pid, Timeout) ->
gen_statem:call(Pid, abort, Timeout).
-spec shutdown(pid()) -> ok.
shutdown(Pid) ->
_ = erlang:exit(Pid, shutdown),
ok.
%%--------------------------------------------------------------------
%% gen_statem callbacks
%%--------------------------------------------------------------------