summaryrefslogtreecommitdiff
path: root/swift/obj
diff options
context:
space:
mode:
authorClay Gerrard <clay.gerrard@gmail.com>2021-11-15 15:51:52 -0600
committerClay Gerrard <clay.gerrard@gmail.com>2021-11-15 15:52:12 -0600
commit591adc845909e97fd3fbcb982262eaec0ecf89ac (patch)
tree86f8cdff19a6fe8bad86b015b36b2bc239522629 /swift/obj
parentbb487bb20ae774db4a52b8a88d902e63170d63d7 (diff)
downloadswift-591adc845909e97fd3fbcb982262eaec0ecf89ac.tar.gz
Fix SSYNC update phase blocking
Same problem as missing_check; but send_* Related-Change-Id: I33c343b7fb9c553cce298157932dc46f8b0d3dcf Change-Id: I9261084862ff0522cabd275fa52de454e6001fc0
Diffstat (limited to 'swift/obj')
-rw-r--r--swift/obj/ssync_receiver.py4
-rw-r--r--swift/obj/ssync_sender.py4
2 files changed, 8 insertions, 0 deletions
diff --git a/swift/obj/ssync_receiver.py b/swift/obj/ssync_receiver.py
index 762556b82..54f70e862 100644
--- a/swift/obj/ssync_receiver.py
+++ b/swift/obj/ssync_receiver.py
@@ -445,6 +445,7 @@ class Receiver(object):
raise Exception('Looking for :UPDATES: START got %r' % line[:1024])
successes = 0
failures = 0
+ updates = 0
while True:
line = self._readline('updates line')
if not line or line.strip() == b':UPDATES: END':
@@ -539,6 +540,9 @@ class Receiver(object):
# subreq.
for junk in subreq.environ['wsgi.input']:
pass
+ if updates % 5 == 0:
+ sleep() # Gives a chance for other greenthreads to run
+ updates += 1
if failures:
raise swob.HTTPInternalServerError(
'ERROR: With :UPDATES: %d failures to %d successes' %
diff --git a/swift/obj/ssync_sender.py b/swift/obj/ssync_sender.py
index 23eb2f86b..9df2d123a 100644
--- a/swift/obj/ssync_sender.py
+++ b/swift/obj/ssync_sender.py
@@ -359,6 +359,7 @@ class Sender(object):
msg = b':UPDATES: START\r\n'
connection.send(b'%x\r\n%s\r\n' % (len(msg), msg))
frag_prefs = [] if self.include_non_durable else None
+ updates = 0
for object_hash, want in send_map.items():
object_hash = urllib.parse.unquote(object_hash)
try:
@@ -394,6 +395,9 @@ class Sender(object):
# continue. The diskfile may however be deleted after a
# successful ssync since it remains in the send_map.
pass
+ if updates % 5 == 0:
+ sleep() # Gives a chance for other greenthreads to run
+ updates += 1
with exceptions.MessageTimeout(
self.daemon.node_timeout, 'updates end'):
msg = b':UPDATES: END\r\n'