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.
@@ -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