13 Commits

Author SHA1 Message Date
Barbara Miller
4ad3cff415 updates for rethinkdb 2.4.9 2023-05-18 17:16:04 -07:00
Noah Levitt
f26704a206 logging.warning instead of warn to assuage py 3.7 2019-05-16 23:29:55 +00:00
Noah Levitt
71221dbe54 minimize impact of down server
The last approach was not good, timeout of 0.1 seconds was too short. A
bunch of stuff has to happen in the timeout period inside of
rethinkdb.connect(). It doesn't offer a way to set only the socket
timeout. Even a timeout of 0.5 seconds results in a noticeable error
rate.

The new approach is to put a server in the penalty box for 5 minutes
when it errors. While the server is in the penalty box, we don't try to
connect to it, unless all the servers are in the penalty box, in which
case we try the server that errored least recently.
2018-11-02 18:05:18 +00:00
Noah Levitt
8ec2d853b6 connect quickly when a server is down
Another tweak to that end. We have observed that when a rethinkdb server
is offline, an attempt to connect to it takes a second or two to time
out. On the other hand, if the host is up but the port is not open
(rethinkdb is not running or something like that), the connection
failure happens very quickly.

To achieve good performance in case a rethinkdb server is down, we are
now setting a timeout on the connect() call. The timeout starts at
0.1 sec, for quick retry, and backs off up to 10 sec in case of repeated
failures.
2018-11-01 19:17:50 +00:00
Noah Levitt
e188c83063 retry quickly on first connection failure then...
... back off on each subsequent retry
2018-10-29 13:34:45 -07:00
Noah Levitt
edf68edaa2 pass through extra args to run() 2018-09-28 12:27:13 -07:00
Noah Levitt
c5b1b0a620 fail after 20 "recoverable" exception in iterator
it turns out that when iterating over results sometimes (always?) errors
that are recoverable when running a query are not recoverable, so we've
been ending up in infinite loops
2018-09-27 12:56:30 -07:00
Noah Levitt
968513cdb5 handle recoverable errors that happen while
iterating over results!
2018-09-17 12:03:51 -07:00
Noah Levitt
7cf33a81ea retry in case of another type of recoverable error from a rethinkdb operation 2017-06-27 10:58:30 -07:00
Noah Levitt
406a617d01 generalize regex to handle another exception message "Cannot perform read: The primary replica isn't connected to a quorum of replicas. ..." 2017-05-01 15:29:27 -07:00
Noah Levitt
6c57b81de8 recover from a transient error, which happens for me at least rethinkdb starts up 2017-05-01 14:01:01 -07:00
Noah Levitt
c14bae6050 new convention, call Rethinker object rr (mnemonic RethinkeR, or *double*[think]), leave rethinkdb as r per the rethinkdb convention 2017-03-01 11:20:27 -08:00
Noah Levitt
e8db41763b rename the project "doublethink" (credit goes to @adam-miller) 2017-02-28 16:44:26 -08:00