Skip to content
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

Remove maven threads configuration based on GOMAXPROCS #5467

Closed
lburgazzoli opened this issue May 7, 2024 · 0 comments · Fixed by #5468
Closed

Remove maven threads configuration based on GOMAXPROCS #5467

lburgazzoli opened this issue May 7, 2024 · 0 comments · Fixed by #5468
Assignees
Labels
area/builder kind/bug Something isn't working

Comments

@lburgazzoli
Copy link
Contributor

lburgazzoli commented May 7, 2024

What happened?

The maven_command sets mavne's artifact and execution threads to the value of GOMAXPROCS however, The Go runtime doesn’t know it’s running in k8s hence, GOMAXPROCS reports the number of cores on the node:

if !util.StringContainsPrefix(c.context.AdditionalArguments, "-Dmaven.artifact.threads") {
args = append(args, "-Dmaven.artifact.threads="+strconv.Itoa(runtime.GOMAXPROCS(0)))
}
if !util.StringSliceExists(c.context.AdditionalArguments, "-T") {
args = append(args, "-T", strconv.Itoa(runtime.GOMAXPROCS(0)))
}

This seems to be wrong an could potential lead to misbehavior as maven is configured to use more resources than what is actually available for the Pod.

Steps to reproduce

  1. start minikube with i.e. half of the cores available
  2. observe an integration build logs
  3. you should see that the maven's -T flag has a value greater than the number of the configured cores
@lburgazzoli lburgazzoli added the kind/bug Something isn't working label May 7, 2024
@lburgazzoli lburgazzoli changed the title Remove mvane thread configuration based on GOMAXPROCS Remove maven thread configuration based on GOMAXPROCS May 7, 2024
@lburgazzoli lburgazzoli self-assigned this May 7, 2024
@lburgazzoli lburgazzoli changed the title Remove maven thread configuration based on GOMAXPROCS Remove maven threads configuration based on GOMAXPROCS May 7, 2024
lburgazzoli added a commit to lburgazzoli/apache-camel-k that referenced this issue May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/builder kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants