This is an automated email from the ASF dual-hosted git repository.
vatamane pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb-erlfdb.git
The following commit(s) were added to refs/heads/main by this push:
new c784cc4 Make the default wait timeout infinity
c784cc4 is described below
commit c784cc4b21c554e276cb309b53f36fe8a2c5b8ac
Author: Nick Vatamaniuc <[email protected]>
AuthorDate: Mon Mar 29 18:47:53 2021 -0400
Make the default wait timeout infinity
This brings the default behavior in line with other FoundationDB client
libraries which don't use client-side timeouts when waiting for futures to
fire.
A few other reasons are:
* Currently we may generate spurious future `ready` messages when timeouts
fire during overload scenarios. The caller would have to know to flush ready
messages if they caught a `{timeout, _}`
* The response may succeed under 5 seconds, but it would be queued in the
networking layer and throw a `timeout` error on the Erlang side.
* Timeouts can be set as a transaction or db handle options. It's easier to
apply configuration defaults there than for individual wait functions.
* Watch futures are not bound by the 5 second transaction time limit, and
they'd have to know about the default `wait/1,2` call timeout to know to
extend it or set it to `infinity`.
---
src/erlfdb.erl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/erlfdb.erl b/src/erlfdb.erl
index cbe738f..8353acd 100644
--- a/src/erlfdb.erl
+++ b/src/erlfdb.erl
@@ -275,7 +275,7 @@ wait_for_any(Futures, Options) ->
wait_for_any(Futures, Options, ResendQ) ->
- Timeout = erlfdb_util:get(Options, timeout, 5000),
+ Timeout = erlfdb_util:get(Options, timeout, infinity),
receive
{MsgRef, ready} = Msg ->
case lists:keyfind(MsgRef, 2, Futures) of