Skip to content

Commit

Permalink
Improve es sniff stability
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerry committed Jan 8, 2021
1 parent 7069e77 commit 32fad35
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
v0.8.5 (2021/1/7)
Improve es sniff stability under high load.

v0.8.4 (2020/12/8)
Expose a utility function for convenience.

Expand Down
4 changes: 2 additions & 2 deletions biothings/utils/web/es_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ def sniff_hosts(self, initial=False):
try:
url = f"http://{host['host']}:{host['port']}"
# yield from session.head(url, raise_for_status=True) TODO
yield from session.head(url, raise_for_status=True, timeout=1.5)
yield from session.head(url, raise_for_status=True, timeout=5)
valid_hosts.append(host)
except aiohttp.ClientError as exc:
except (aiohttp.ClientError, asyncio.TimeoutError) as exc:
logger.warning(str(exc))
finally:
yield from session.close()
Expand Down
2 changes: 1 addition & 1 deletion biothings/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# All biothings versions (including in setup.py) are sourced from these
MAJOR_VER = 0
MINOR_VER = 8
MICRO_VER = 4
MICRO_VER = 5

0 comments on commit 32fad35

Please sign in to comment.