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:
parent
cc3275b389
commit
3d428a2e0e
|
@ -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()}.
|
||||
|
|
|
@ -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
|
||||
%%--------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue