mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 00:20:08 +00:00
bitbake: hashserv: Chunkify large messages
The hash equivalence client and server can occasionally send messages that are too large for the server to fit in the receive buffer (64 KB). To prevent this, support is added to the protocol to "chunkify" the stream and break it up into manageable pieces that the server can each side can back together. Ideally, this would be negotiated by the client and server, but it's currently hard coded to 32 KB to prevent the round-trip delay. (Bitbake rev: e27a28c1e40e886ee68ba4b99b537ffc9c3577d4) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
b3f212d6bc
commit
07a02b31fd
@@ -99,6 +99,29 @@ class TestHashEquivalenceServer(object):
|
||||
result = self.client.get_unihash(self.METHOD, taskhash)
|
||||
self.assertEqual(result, unihash)
|
||||
|
||||
def test_huge_message(self):
|
||||
# Simple test that hashes can be created
|
||||
taskhash = 'c665584ee6817aa99edfc77a44dd853828279370'
|
||||
outhash = '3c979c3db45c569f51ab7626a4651074be3a9d11a84b1db076f5b14f7d39db44'
|
||||
unihash = '90e9bc1d1f094c51824adca7f8ea79a048d68824'
|
||||
|
||||
result = self.client.get_unihash(self.METHOD, taskhash)
|
||||
self.assertIsNone(result, msg='Found unexpected task, %r' % result)
|
||||
|
||||
siginfo = "0" * (self.client.max_chunk * 4)
|
||||
|
||||
result = self.client.report_unihash(taskhash, self.METHOD, outhash, unihash, {
|
||||
'outhash_siginfo': siginfo
|
||||
})
|
||||
self.assertEqual(result['unihash'], unihash, 'Server returned bad unihash')
|
||||
|
||||
result = self.client.get_taskhash(self.METHOD, taskhash, True)
|
||||
self.assertEqual(result['taskhash'], taskhash)
|
||||
self.assertEqual(result['unihash'], unihash)
|
||||
self.assertEqual(result['method'], self.METHOD)
|
||||
self.assertEqual(result['outhash'], outhash)
|
||||
self.assertEqual(result['outhash_siginfo'], siginfo)
|
||||
|
||||
def test_stress(self):
|
||||
def query_server(failures):
|
||||
client = Client(self.server.address)
|
||||
|
||||
Reference in New Issue
Block a user