Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f0cfde36f2 | ||
|
|
7e220d2741 | ||
|
|
c4b1351a43 | ||
|
|
90d2597bc3 | ||
|
|
c1508c94c2 |
No files matched your search
@@ -70,6 +70,7 @@ test:json-api:
|
||||
paths:
|
||||
- lbrynet-${OS}.zip
|
||||
script:
|
||||
- pip install --upgrade 'setuptools<45.0.0'
|
||||
- pip install pyinstaller
|
||||
- python3.7 docker/set_build.py
|
||||
- pip install -e .
|
||||
@@ -125,6 +126,7 @@ build:windows:
|
||||
after_script:
|
||||
- rmdir -Recurse venv
|
||||
script:
|
||||
- pip install --upgrade 'setuptools<45.0.0'
|
||||
- pip install pyinstaller
|
||||
- python docker/set_build.py
|
||||
- pip install -e .
|
||||
|
||||
-51
@@ -1,51 +0,0 @@
|
||||
dist: xenial
|
||||
language: python
|
||||
python: "3.7"
|
||||
|
||||
jobs:
|
||||
include:
|
||||
|
||||
- stage: code quality
|
||||
name: "pylint & mypy"
|
||||
install:
|
||||
- make install tools
|
||||
script: make lint
|
||||
|
||||
- stage: test
|
||||
name: "Unit Tests"
|
||||
install:
|
||||
- make install tools
|
||||
script:
|
||||
- HOME=/tmp coverage run -p --source=lbry -m unittest discover -vv tests.unit
|
||||
|
||||
- name: "Integration Tests - Data Network"
|
||||
install:
|
||||
- pip install tox-travis
|
||||
- sudo mount -o mode=1777,nosuid,nodev -t tmpfs tmpfs /tmp
|
||||
script: tox -e datanetwork
|
||||
|
||||
- name: "Integration Tests - Blockchain"
|
||||
install:
|
||||
- pip install tox-travis
|
||||
- sudo mount -o mode=1777,nosuid,nodev -t tmpfs tmpfs /tmp
|
||||
script: tox -e blockchain
|
||||
|
||||
- name: "Integration Tests - Other"
|
||||
install:
|
||||
- pip install tox-travis
|
||||
- sudo mount -o mode=1777,nosuid,nodev -t tmpfs tmpfs /tmp
|
||||
script: tox -e other
|
||||
|
||||
- name: "Run Examples"
|
||||
install:
|
||||
- make install tools
|
||||
script:
|
||||
- HOME=/tmp coverage run -p --source=lbry scripts/generate_json_api.py
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/venv
|
||||
- $HOME/.cache/pip
|
||||
- $HOME/Library/Caches/pip
|
||||
- $HOME/Library/Caches/Homebrew
|
||||
- $TRAVIS_BUILD_DIR/.tox
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
__version__ = "0.52.0"
|
||||
__version__ = "0.53.1"
|
||||
version = tuple(map(int, __version__.split('.'))) # pylint: disable=invalid-name
|
||||
+5
-11
@@ -77,7 +77,7 @@ class ClientSession(BaseClientSession):
|
||||
self.synchronous_close()
|
||||
raise
|
||||
except asyncio.CancelledError:
|
||||
log.warning("cancelled sending %s to %s:%i", method, *self.server)
|
||||
log.info("cancelled sending %s to %s:%i", method, *self.server)
|
||||
self.synchronous_close()
|
||||
raise
|
||||
finally:
|
||||
@@ -90,7 +90,6 @@ class ClientSession(BaseClientSession):
|
||||
while True:
|
||||
try:
|
||||
if self.is_closing():
|
||||
log.warning("is closing, reconnect")
|
||||
await self.create_connection(self.timeout)
|
||||
await self.ensure_server_version()
|
||||
self._on_connect_cb()
|
||||
@@ -100,14 +99,10 @@ class ClientSession(BaseClientSession):
|
||||
except RPCError as e:
|
||||
log.warning("Server error, ignoring for 1h: %s:%d -- %s", *self.server, e.message)
|
||||
retry_delay = 60 * 60
|
||||
except asyncio.TimeoutError:
|
||||
log.error("closing due to timeout")
|
||||
except (asyncio.TimeoutError, OSError):
|
||||
await self.close()
|
||||
retry_delay = min(60, retry_delay * 2)
|
||||
log.warning("Wallet server timeout (retry in %s seconds): %s:%d", retry_delay, *self.server)
|
||||
except Exception:
|
||||
log.exception("unexpected error")
|
||||
raise
|
||||
log.debug("Wallet server timeout (retry in %s seconds): %s:%d", retry_delay, *self.server)
|
||||
try:
|
||||
await asyncio.wait_for(self.trigger_urgent_reconnect.wait(), timeout=retry_delay)
|
||||
except asyncio.TimeoutError:
|
||||
@@ -132,7 +127,7 @@ class ClientSession(BaseClientSession):
|
||||
controller.add(request.args)
|
||||
|
||||
def connection_lost(self, exc):
|
||||
log.warning("Connection lost: %s:%d", *self.server)
|
||||
log.debug("Connection lost: %s:%d", *self.server)
|
||||
super().connection_lost(exc)
|
||||
self.response_time = None
|
||||
self.connection_latency = None
|
||||
@@ -228,8 +223,7 @@ class Network:
|
||||
except asyncio.TimeoutError:
|
||||
log.warning("Wallet server call timed out, retrying.")
|
||||
except ConnectionError:
|
||||
log.warning("Ignoring connection error")
|
||||
log.warning("Raising cancelled error")
|
||||
pass
|
||||
raise asyncio.CancelledError() # if we got here, we are shutting down
|
||||
|
||||
def _update_remote_height(self, header_args):
|
||||
|
||||
@@ -115,7 +115,6 @@ class SessionBase(asyncio.Protocol):
|
||||
try:
|
||||
await asyncio.wait_for(self._can_send.wait(), secs)
|
||||
except asyncio.TimeoutError:
|
||||
self.logger.warning("abort connection after limited wait (%s)", secs)
|
||||
self.abort()
|
||||
raise asyncio.TimeoutError(f'task timed out after {secs}s')
|
||||
|
||||
@@ -132,7 +131,6 @@ class SessionBase(asyncio.Protocol):
|
||||
self.transport.write(framed_message)
|
||||
|
||||
def _bump_errors(self):
|
||||
self.logger.warning("bump errors %i", self.errors)
|
||||
self.errors += 1
|
||||
if self.errors >= self.max_errors:
|
||||
# Don't await self.close() because that is self-cancelling
|
||||
@@ -183,7 +181,6 @@ class SessionBase(asyncio.Protocol):
|
||||
"""Called by asyncio when the connection closes.
|
||||
|
||||
Tear down things done in connection_made."""
|
||||
self.logger.error("connection lost to %s - %s", self.peer_address_str(), exc)
|
||||
self._address = None
|
||||
self.transport = None
|
||||
self._task_group.cancel()
|
||||
@@ -223,14 +220,12 @@ class SessionBase(asyncio.Protocol):
|
||||
|
||||
def abort(self):
|
||||
"""Forcefully close the connection."""
|
||||
self.logger.warning("abort connection")
|
||||
if self.transport:
|
||||
self.transport.abort()
|
||||
|
||||
# TODO: replace with synchronous_close
|
||||
async def close(self, *, force_after=30):
|
||||
"""Close the connection and return when closed."""
|
||||
self.logger.warning("close connection")
|
||||
self._close()
|
||||
if self._pm_task:
|
||||
with suppress(CancelledError):
|
||||
@@ -239,7 +234,6 @@ class SessionBase(asyncio.Protocol):
|
||||
await self._pm_task
|
||||
|
||||
def synchronous_close(self):
|
||||
self.logger.warning("synchronous close")
|
||||
self._close()
|
||||
if self._pm_task and not self._pm_task.done():
|
||||
self._pm_task.cancel()
|
||||
@@ -400,7 +394,7 @@ class RPCSession(SessionBase):
|
||||
try:
|
||||
requests = self.connection.receive_message(message)
|
||||
except ProtocolError as e:
|
||||
self.logger.warning(f'protocol error {e}')
|
||||
self.logger.debug(f'{e}')
|
||||
if e.error_message:
|
||||
await self._send_message(e.error_message)
|
||||
if e.code == JSONRPC.PARSE_ERROR:
|
||||
|
||||
Reference in new issue
Block a user