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

[python] use vfork to start the python interpreter (needed for openjdk) #661

Merged
merged 1 commit into from
Oct 27, 2023

Conversation

eolivelli
Copy link
Member

@eolivelli eolivelli commented Oct 27, 2023

After the upgrade to OpenJDK in kubernetes I see this error.

The fix is to apply this system property -Djdk.lang.Process.launchMechanism=vfork

Please note that we were already using that flag in the langstream docker tester docker image (for docker run)


java.io.IOException: Cannot run program "python3": error=0, Failed to exec spawn helper: pid: 31, exit value: 1                                  │
│ runtime     at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1143)                                                                        │
│ runtime     at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1073)                                                                        │
│ runtime     at ai.langstream.agents.grpc.PythonGrpcServer.start(PythonGrpcServer.java:87)                                                                │
│ runtime     at ai.langstream.agents.grpc.PythonGrpcAgentProcessor.start(PythonGrpcAgentProcessor.java:36)                                                │
│ runtime     at ai.langstream.api.runner.code.AgentCodeAndLoader.executeWithContextClassloader(AgentCodeAndLoader.java:46)                                │
│ runtime     at ai.langstream.api.runner.code.AgentCodeAndLoader$3.start(AgentCodeAndLoader.java:254)                                                     │
│ runtime     at ai.langstream.runtime.agent.AgentRunner.runMainLoop(AgentRunner.java:619)                                                                 │
│ runtime     at ai.langstream.runtime.agent.AgentRunner.runJavaAgent(AgentRunner.java:396)                                                                │
│ runtime     at ai.langstream.runtime.agent.AgentRunner.run(AgentRunner.java:186)                                                                         │
│ runtime     at ai.langstream.runtime.agent.AgentRunnerStarter.start(AgentRunnerStarter.java:120)                                                         │
│ runtime     at ai.langstream.runtime.agent.AgentRunnerStarter.main(AgentRunnerStarter.java:55)                                                           │
│ runtime     at ai.langstream.runtime.Main.main(Main.java:42)                                                                                             │
│ runtime Caused by: java.io.IOException: error=0, Failed to exec spawn helper: pid: 31, exit value: 1                                                     │
│ runtime     at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)                                                                                │
│ runtime     at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:314)                                                                              │
│ runtime     at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:244)      

@eolivelli eolivelli merged commit d80c7f0 into main Oct 27, 2023
8 of 10 checks passed
@eolivelli eolivelli deleted the impl/openjdk-python-vfork branch October 27, 2023 15:39
benfrank241 pushed a commit to vectorize-io/langstream that referenced this pull request May 2, 2024
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.

1 participant