fix(hstream): handle the `unavailable` error code

The "unavailable" error code just means that the HStream is warming up or busy, HStream guarantees that a retry will work well.
This commit is contained in:
firest 2023-07-19 14:43:50 +08:00
parent a9191f3c33
commit 7ac8715358
1 changed files with 7 additions and 0 deletions

View File

@ -309,6 +309,13 @@ do_append_records(false, Producer, Record) ->
msg => "HStreamDB producer sync append success",
record => Record
});
%% the HStream is warming up or buzy, something are not ready yet, retry after a while
{error, {unavailable, _} = Reason} ->
{error,
{recoverable_error, #{
msg => "HStreamDB is warming up or buzy, will retry after a moment",
reason => Reason
}}};
{error, Reason} = Err ->
?tp(
hstreamdb_connector_query_return,