From ab27203100482f0959b57d04f413f7f2e84ea200 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Wed, 25 Jul 2018 13:01:13 -0300 Subject: [PATCH] improve exception logging and add a docstring on the interaction between downloaders --- lbrynet/core/HTTPBlobDownloader.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lbrynet/core/HTTPBlobDownloader.py b/lbrynet/core/HTTPBlobDownloader.py index f25ef1955..b01621aaa 100644 --- a/lbrynet/core/HTTPBlobDownloader.py +++ b/lbrynet/core/HTTPBlobDownloader.py @@ -9,6 +9,13 @@ log = logging.getLogger(__name__) class HTTPBlobDownloader(object): + ''' + A downloader that is able to get blobs from HTTP mirrors. + Note that when a blob gets downloaded from a mirror or from a peer, BlobManager will mark it as completed + and cause any other type of downloader to progress to the next missing blob. Also, BlobFile is naturally able + to cancel other writers when a writer finishes first. That's why there is no call to cancel/resume/stop between + different types of downloaders. + ''' def __init__(self, blob_manager, blob_hashes=None, servers=None, client=None): self.blob_manager = blob_manager self.servers = servers or [] @@ -49,7 +56,7 @@ class HTTPBlobDownloader(object): self.failures = 0 except Exception as exception: self.failures += 1 - log.error('Mirror failed downloading: %s', exception) + log.exception('Mirror failed downloading') if self.failures >= self.max_failures: self.stop() self.failures = 0