Merge branch 'fix_on_high_cpu_usage_on_incomplete_streams'

This commit is contained in:
Jack Robison 2018-07-17 13:24:06 -04:00
commit 0ec8739d5a
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2
2 changed files with 5 additions and 1 deletions

View file

@ -14,7 +14,7 @@ at anytime.
### Fixed
* daemon cli spelling fixes
*
* high CPU usage when a stream is incomplete and the peers we're requesting from have no more blobs to send us
### Deprecated
*

View file

@ -354,6 +354,10 @@ class AvailabilityRequest(RequestHelper):
log.debug("Received a response to the availability request")
# save available blobs
blob_hashes = response_dict['available_blobs']
if not blob_hashes:
# should not send any more requests as it doesnt have any blob we need
self.peer.update_score(-10.0)
return True
for blob_hash in blob_hashes:
if blob_hash in request.request_dict['requested_blobs']:
self.process_available_blob_hash(blob_hash, request)