Browse Source

Fix SSYNC/missing_check is blocking

Change-Id: I9979504b475a731f316960b497056b2824655c6f
tags/2.25.0
Romain LE DISEZ 9 months ago
parent
commit
3fe9b582ef
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      swift/obj/ssync_receiver.py

+ 5
- 0
swift/obj/ssync_receiver.py View File

@@ -16,6 +16,7 @@

import eventlet.greenio
import eventlet.wsgi
from eventlet import sleep
from six.moves import urllib

from swift.common import exceptions
@@ -341,6 +342,7 @@ class Receiver(object):
raise Exception(
'Looking for :MISSING_CHECK: START got %r' % line[:1024])
object_hashes = []
nlines = 0
while True:
with exceptions.MessageTimeout(
self.app.client_timeout, 'missing_check line'):
@@ -350,6 +352,9 @@ class Receiver(object):
want = self._check_missing(line)
if want:
object_hashes.append(want)
if nlines % 5 == 0:
sleep() # Gives a chance for other greenthreads to run
nlines += 1
yield b':MISSING_CHECK: START\r\n'
if object_hashes:
yield b'\r\n'.join(hsh.encode('ascii') for hsh in object_hashes)


Loading…
Cancel
Save