mirror of
https://github.com/internetarchive/warcprox.git
synced 2025-01-18 13:22:09 +01:00
fix handling of rethinkdb exception
This commit is contained in:
parent
d98f03012b
commit
67beec4b80
@ -44,16 +44,27 @@ class Rethinker:
|
|||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
|
|
||||||
def run(self, query):
|
def run(self, query):
|
||||||
|
import rethinkdb as r
|
||||||
while True:
|
while True:
|
||||||
with self._random_server_connection() as conn:
|
with self._random_server_connection() as conn:
|
||||||
try:
|
try:
|
||||||
return query.run(conn, db=self.db)
|
return query.run(conn, db=self.db)
|
||||||
except (r.ReqlAvailabilityError, r.ReqlTimeoutError) as e:
|
except (r.ReqlAvailabilityError, r.ReqlTimeoutError) as e:
|
||||||
self.logger.error("will retry rethinkdb query/operation %s which failed like so:", exc_info=True)
|
self.logger.error("will retry rethinkdb query/operation %s which failed like so:", query, exc_info=True)
|
||||||
|
|
||||||
version_bytes = _read_version_bytes().strip()
|
version_bytes = _read_version_bytes().strip()
|
||||||
version_str = version_bytes.decode('utf-8')
|
version_str = version_bytes.decode('utf-8')
|
||||||
|
|
||||||
|
def gettid():
|
||||||
|
try:
|
||||||
|
import ctypes
|
||||||
|
libc = ctypes.cdll.LoadLibrary('libc.so.6')
|
||||||
|
SYS_gettid = 186
|
||||||
|
tid = libc.syscall(SYS_gettid)
|
||||||
|
return tid
|
||||||
|
except:
|
||||||
|
logging.warn("gettid failed?")
|
||||||
|
|
||||||
import warcprox.controller as controller
|
import warcprox.controller as controller
|
||||||
import warcprox.playback as playback
|
import warcprox.playback as playback
|
||||||
import warcprox.dedup as dedup
|
import warcprox.dedup as dedup
|
||||||
|
Loading…
x
Reference in New Issue
Block a user