Skip to content

Commit 53da7bb

Browse files
committed
Add workaround to prevent go build from hanging
There is an issue that causes go multiarch to hang indefinitely sometimes: golang/go#70329 Per the comments on the issue, it seems setting GOMACPROCS to a small number can relieve this issue as a temporary WA Signed-off-by: Salvatore Daniele <[email protected]>
1 parent 76af3b2 commit 53da7bb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

extraConfigDpu.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,13 @@ def build_push(self, builder_image: str, base_image: str) -> None:
6161
logger.info(f"Building dpu operator images in {self.repo_path} on {h.hostname()} with timeout of 1h")
6262

6363
def build_and_push() -> None:
64-
h.run_or_die(f"make -C {self.repo_path} local-buildx -j8")
64+
# There is an issue that causes go multiarch to hang indefinitely sometimes: https://github.com/golang/go/issues/70329
65+
# Per the comments on the issue, it seems setting GOMACPROCS to a small number can relieve this issue as a temporary WA
66+
env = os.environ.copy()
67+
env["GOMAXPROCS"] = 2
68+
ret = h.run(f"make -C {self.repo_path} local-buildx -j8", env=env)
69+
if not ret.success():
70+
logger.error_and_exit(f"Error occured while building Dpu operator: err: {ret.err}")
6571
h.run_or_die(f"make -C {self.repo_path} local-pushx")
6672

6773
common.with_timeout(3600, build_and_push)

0 commit comments

Comments
 (0)