Skip to content

Add workaround to prevent go build from hanging #321

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 18, 2025

Conversation

SalDaniele
Copy link
Collaborator

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

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]>
@SalDaniele SalDaniele merged commit cd89af2 into bn222:main Feb 18, 2025
1 check passed
@thom311
Copy link
Contributor

thom311 commented Feb 19, 2025

@SalDaniele are you sure this works?

you are setting the environment variable for running make local-buildx. However, that make step runs buildah build commands, which I think is the one that hangs (inside the containers).

I don't think external environment variables are passed down via buildah/podman, unless you pass buildah build --env.

I think what might works is (untested)

env["LOCAL_BUILDX_ARGS"] = "--env=GOMAXPROCS=2"

Or better patch this in dpu-operator instead of CDA. After all, it's dpu-operator that uses known-problematic base images like registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.23-openshift-4.19. CDA shouldn't care what make local-buildx does or how to workaround some golang issue deep down in what dpu-operator does.

@thom311
Copy link
Contributor

thom311 commented Feb 19, 2025

Or better patch this in dpu-operator instead of CDA. After all, it's dpu-operator that uses known-problematic base images like registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.23-openshift-4.19. CDA shouldn't care what make local-buildx does or how to workaround some golang issue deep down in what dpu-operator does.

To be precise, the Dockerfiles that use the problematic base images and that run the hanging build command, should contain a ENV GOMAXPROCS=2. Or even better

RUN GOMAXPROCS=2 CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} make build-daemon
#   ^^^^^^^^^^^^

@bn222
Copy link
Owner

bn222 commented Feb 19, 2025

Or better patch this in dpu-operator instead of CDA. After all, it's dpu-operator that uses known-problematic base images like registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.23-openshift-4.19. CDA shouldn't care what make local-buildx does or how to workaround some golang issue deep down in what dpu-operator does.

This is a very good point. If you fix it in DPU operator, a developer can do a rebuild without depending on "logic" in CDA. @thom311 Thank you for your observation.

@SalDaniele
Copy link
Collaborator Author

Yes this makes sense, I will try adding this in the dpu operator directly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants