summaryrefslogtreecommitdiff
path: root/swift/obj
diff options
context:
space:
mode:
authorClay Gerrard <clay.gerrard@gmail.com>2021-11-15 11:23:55 -0600
committerClay Gerrard <clay.gerrard@gmail.com>2021-11-15 11:24:25 -0600
commitbb487bb20ae774db4a52b8a88d902e63170d63d7 (patch)
tree43021d627250fd177dce95d693eb649d1a2c3e65 /swift/obj
parentf91074f376937699dcb0901a9c46030032730773 (diff)
downloadswift-bb487bb20ae774db4a52b8a88d902e63170d63d7.tar.gz
Fix SSYNC/missing_check blocking (sender)
Related-Change-Id: I9979504b475a731f316960b497056b2824655c6f Change-Id: I33c343b7fb9c553cce298157932dc46f8b0d3dcf
Diffstat (limited to 'swift/obj')
-rw-r--r--swift/obj/ssync_sender.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/swift/obj/ssync_sender.py b/swift/obj/ssync_sender.py
index 27d143210..23eb2f86b 100644
--- a/swift/obj/ssync_sender.py
+++ b/swift/obj/ssync_sender.py
@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+from eventlet import sleep
import six
from six.moves import urllib
@@ -297,6 +298,7 @@ class Sender(object):
lambda objhash_timestamps:
objhash_timestamps[0] in
self.remote_check_objs, hash_gen)
+ nlines = 0
for object_hash, timestamps in hash_gen:
available_map[object_hash] = timestamps
with exceptions.MessageTimeout(
@@ -304,6 +306,9 @@ class Sender(object):
'missing_check send line'):
msg = b'%s\r\n' % encode_missing(object_hash, **timestamps)
connection.send(b'%x\r\n%s\r\n' % (len(msg), msg))
+ if nlines % 5 == 0:
+ sleep() # Gives a chance for other greenthreads to run
+ nlines += 1
with exceptions.MessageTimeout(
self.daemon.node_timeout, 'missing_check end'):
msg = b':MISSING_CHECK: END\r\n'