summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnatol Belski <anbelski@linux.microsoft.com>2020-09-17 14:24:48 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-09-23 20:55:53 +0100
commit79ce7f1c8234139cf8f2984c1c6d36aa04692742 (patch)
tree6f2c7f8c098a9da826f5904b10e708a9218cd122
parent50ed030f17aa49d6b88e821ff6d373d309617211 (diff)
downloadpoky-79ce7f1c8234139cf8f2984c1c6d36aa04692742.tar.gz
bitbake: bitbake: hashserv: Fix localhost sometimes resolved to a wrong IP
Using localhost for direct builds on host is fine. A case with a misbehavior has been sighted on a Docker build. Even when the host supports IPv6, but Docker is not configured correspondingly - some versions of the asyncio Python module seem to misbehave and try to use IPv6 where it's not supported in the container. This happens at least on some Ubuntu 18.04 based containers, resolving the IP explicitly appears to be the fix. (Bitbake rev: 0e20f91c11afdc17ea776aa02e0cc8b0d59a23d4) Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/hashserv/tests.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/bitbake/lib/hashserv/tests.py b/bitbake/lib/hashserv/tests.py
index b34c436876..4566f24738 100644
--- a/bitbake/lib/hashserv/tests.py
+++ b/bitbake/lib/hashserv/tests.py
@@ -14,6 +14,7 @@ import sys
14import tempfile 14import tempfile
15import threading 15import threading
16import unittest 16import unittest
17import socket
17 18
18 19
19class TestHashEquivalenceServer(object): 20class TestHashEquivalenceServer(object):
@@ -163,4 +164,8 @@ class TestHashEquivalenceUnixServer(TestHashEquivalenceServer, unittest.TestCase
163 164
164class TestHashEquivalenceTCPServer(TestHashEquivalenceServer, unittest.TestCase): 165class TestHashEquivalenceTCPServer(TestHashEquivalenceServer, unittest.TestCase):
165 def get_server_addr(self): 166 def get_server_addr(self):
166 return "localhost:0" 167 # Some hosts cause asyncio module to misbehave, when IPv6 is not enabled.
168 # If IPv6 is enabled, it should be safe to use localhost directly, in general
169 # case it is more reliable to resolve the IP address explicitly.
170 return socket.gethostbyname("localhost") + ":0"
171