A (possibly mislabeled) OOM error occurs when a user has too many services and creates a new one
还没有人认领这个 Issue。
评估
调研方向
从 HelmAppsService 中第 249 行附近的 getUserServices 和第 370 行附近的 getHelmApp 开始,然后跟踪通过 HelmInstallService.getAll 和 Command.execute 发起的并行 helm get all 调用。通过并行运行大量 helm get all 操作来复现该故障。完成的标准是,服务列表不再耗尽原生线程或进程,并且可以在 onyxia-api 中配置并行度上限。
由索引模型根据 Issue 内容生成。
描述
Hi,
One of our Onyxia users is frequently facing an error when creating a new service on the Onyxia UI, and after some rough testing, it seems that this could be caused by the fact this user has a large number of running service (24), which in turn has Onyxia API start that many threads to manage the listing request emanating from Onyxia UI.
Other users with fewer services couldn't reproduce the error. On the other hand, using kubectl exec to get a shell on the Onyxia API pod to try and run many helm get all ... in parallel ends up with the same error.
What's puzzling is that the error mentions some processes limit (ulimit -u) on the Golang side, and OOM Error on the Java side, but it doesn't seem look like we are limited on either of those sides (unlimited user processes as viewed in the container, and 4/16Go requests/limits for RAM) :
2024-04-29 10:29:29.214 runtime: may need to increase max user processes (ulimit -u)
2024-04-29 10:29:29.214 runtime: failed to create new OS thread (have 8 already; errno=11)
2024-04-29 10:29:29.214 fatal error: newosproc
2024-04-29 10:29:29.214 runtime: may need to increase max user processes (ulimit -u)
2024-04-29 10:29:29.214 runtime: failed to create new OS thread (have 7 already; errno=11)
2024-04-29 10:29:29.214 fatal error: newosproc
2024-04-29 10:29:29.214 runtime: may need to increase max user processes (ulimit -u)
2024-04-29 10:29:29.214 runtime: failed to create new OS thread (have 7 already; errno=11)
2024-04-29 10:29:29.213 fatal error: newosproc
2024-04-29 10:29:29.213 runtime: may need to increase max user processes (ulimit -u)
2024-04-29 10:29:29.213 runtime: failed to create new OS thread (have 5 already; errno=11)
2024-04-29 10:29:29.211 fatal error: newosproc
2024-04-29 10:29:29.211 runtime: may need to increase max user processes (ulimit -u)
2024-04-29 10:29:29.211 runtime: failed to create new OS thread (have 6 already; errno=11)
2024-04-24T07:09:37.528Z WARN 7 --- [ool-worker-8074] i.g.i.h.service.HelmInstallService : Exception occurre
org.zeroturnaround.exec.ProcessInitException: Could not execute [helm, get, all, vscode-python-273990, --namespace, REDACTED]. Error=11, Resource temporarily unavailable at org.zeroturnaround.exec.ProcessInitException.newInstance(ProcessInitException.java:80) ~[zt-exec-1.12.jar:na] at org.zeroturnaround.exec.ProcessExecutor.invokeStart(ProcessExecutor.java:1002) ~[zt-exec-1.12.jar:na] at org.zeroturnaround.exec.ProcessExecutor.startInternal(ProcessExecutor.java:970) ~[zt-exec-1.12.jar:na] at org.zeroturnaround.exec.ProcessExecutor.execute(ProcessExecutor.java:906) ~[zt-exec-1.12.jar:na] at io.github.inseefrlab.helmwrapper.utils.Command.execute(Command.java:73) ~[java-helm-wrapper-v2.5.0.jar:v2.5.0
at io.github.inseefrlab.helmwrapper.service.HelmInstallService.getAll(HelmInstallService.java:139) ~[java-helm-wrapper-v2.5.0.jar:v2.5.0] at fr.insee.onyxia.api.services.impl.HelmAppsService.getHelmApp(HelmAppsService.java:370) ~[classes/:v2.5.0] at fr.insee.onyxia.api.services.impl.HelmAppsService.lambda$getUserServices$2(HelmAppsService.java:249) ~[classes/:v2.5.0] at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) ~[na:na] at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Unknown Source) ~[na:na] at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source) ~[na:na] at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) ~[na:na] at java.base/java.util.stream.ReduceOps$ReduceTask.doLeaf(Unknown Source) ~[na:na] at java.base/java.util.stream.ReduceOps$ReduceTask.doLeaf(Unknown Source) ~[na:na] at java.base/java.util.stream.AbstractTask.compute(Unknown Source) ~[na:na] at java.base/java.util.concurrent.CountedCompleter.exec(Unknown Source) ~[na:na] at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source) ~[na:na] at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source) ~[na:na] at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source) ~[na:na] at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) ~[na:na] at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source) ~[na:na]Caused by: java.io.IOException: Cannot run program "helm": error=11, Resource temporarily unavailable at java.base/java.lang.ProcessBuilder.start(Unknown Source) ~[na:na] at java.base/java.lang.ProcessBuilder.start(Unknown Source) ~[na:na] at org.zeroturnaround.exec.ProcessExecutor.invokeStart(ProcessExecutor.java:997) ~[zt-exec-1.12.jar:na] ... 19 common frames omittedCaused by: java.io.IOException: error=11, Resource temporarily unavailable at java.base/java.lang.ProcessImpl.forkAndExec(Native Method) ~[na:na] at java.base/java.lang.ProcessImpl.<init>(Unknown Source) ~[na:na] at java.base/java.lang.ProcessImpl.start(Unknown Source) ~[na:na] ... 22 common frames omitte
[773707.539s][warning][os,thread] Failed to start thread "Unknown thread" - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 4k, detached.[773707.540s][warning][os,thread] Failed to start the native thread for java.lang.Thread "Thread-54750"
2024-04-24T07:09:37.905Z ERROR 7 --- [nio-8080-exec-9] o.a.c.c.C.[.[.[.[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [/api] threw exception [Request processing failed: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError] with root caus
java.lang.OutOfMemoryError: unable to create native thread: possibly out of memory or process/resource limits reached at java.base/java.lang.Thread.start0(Native Method) ~[na:na] at java.base/java.lang.Thread.start(Unknown Source) ~[na:na] at org.zeroturnaround.exec.stream.PumpStreamHandler.start(PumpStreamHandler.java:175) ~[zt-exec-1.12.jar:na] at org.zeroturnaround.exec.ProcessExecutor.startInternal(ProcessExecutor.java:1050) ~[zt-exec-1.12.jar:na] at org.zeroturnaround.exec.ProcessExecutor.startInternal(ProcessExecutor.java:981) ~[zt-exec-1.12.jar:na] at org.zeroturnaround.exec.ProcessExecutor.execute(ProcessExecutor.java:906) ~[zt-exec-1.12.jar:na] at io.github.inseefrlab.helmwrapper.utils.Command.execute(Command.java:73) ~[java-helm-wrapper-v2.5.0.jar:v2.5.0
at io.github.inseefrlab.helmwrapper.service.HelmInstallService.getAll(HelmInstallService.java:139) ~[java-helm-wrapper-v2.5.0.jar:v2.5.0] at fr.insee.onyxia.api.services.impl.HelmAppsService.getHelmApp(HelmAppsService.java:370) ~[classes/:v2.5.0] at fr.insee.onyxia.api.services.impl.HelmAppsService.lambda$getUserServices$2(HelmAppsService.java:249) ~[classes/:v2.5.0] at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) ~[na:na] at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Unknown Source) ~[na:na] at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source) ~[na:na] at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) ~[na:na] at java.base/java.util.stream.ReduceOps$ReduceTask.doLeaf(Unknown Source) ~[na:na] at java.base/java.util.stream.ReduceOps$ReduceTask.doLeaf(Unknown Source) ~[na:na] at java.base/java.util.stream.AbstractTask.compute(Unknown Source) ~[na:na] at java.base/java.util.concurrent.CountedCompleter.exec(Unknown Source) ~[na:na] at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source) ~[na:na] at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source) ~[na:na] at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source) ~[na:na] at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) ~[na:na] at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source) ~[na:na
After discussing with @olevitt, a possible way out of this could be to add a parameter in onyxia-api to allow limiting the maximum number of threads used for parallelization.
- 主要语言
- Java
- 星标
- 34
- 派生
- 34
- 平均合并
- 9 分钟
- 30 天内合并 PR
- 4
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
InseeFrLab/onyxia-api 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 43/100
InseeFrLab/onyxia-api#689 ·
-
Security : run helm installs / upgrades / uninstalls as a service account local to the target namespace可能已有人在做 @olevitt 于 10 天前认领。 未关闭
难度 5/5 一周以上 新手友好度 35/100
InseeFrLab/onyxia-api#688 ·
-
难度 3/5 1-2 天 新手友好度 74/100
InseeFrLab/onyxia-api#669 ·
-
helmwrapper issue with rootless env : try to create /.cache可能重新可做 @olevitt 于 344 天前认领,目前没有进行中的 PR。 未关闭
InseeFrLab/onyxia-api#638 · 5 条评论 · 已指派 1 人 ·
-
难度 3/5 1-2 天 新手友好度 38/100
InseeFrLab/onyxia-api#612 · 3 条评论 ·
查看 InseeFrLab/onyxia-api 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
liberation-data/drivine4j#547 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 70/100
-
BindingServiceProperties.bindings regressed to a non-thread-safe TreeMap in GH-3158: concurrent first use of binding names corrupts it可能已有人在做 @AkashB23 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 62/100
spring-cloud/spring-cloud-stream#3321 ·
维护者通常 1 天内回复
-
[Bug] 资源包列表 与 模组/数据包/世界 列表排列顺序不一致可能已有人在做 @fishdry1000 于 4 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
ai-driven-fuzzing bug claude Minor
难度 2/5 1-3 小时 新手友好度 72/100
linagora/twake-calendar-side-service#1333 ·
维护者通常 1 天内回复