This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-05-14
Channels
I ran into this https://bugs.openjdk.java.net/browse/JDK-8218546 issue they fixed it here https://bugs.openjdk.java.net/browse/JDK-8213189 , when will this fix be in graalvm + babashka?
@U02CV2P4J6S which bb version are you using? we are compiling with GraalVM 22.1.0 based on JDK 11.0.15. According to the issue, this is backported to 11.0.14
ah I remember now I was using my own compiled one. Should be with graalvm-ce-java11-22.0.0.2 but I will try official bb release
right, since 0.8.0
it should work
awesome 😄
I'm getting an intermittent error :cause "Socket closed"
when running a simple task like bar (shell "date")
. Anyone know why it's happening? I think it started after I began using pods in my bb.edn. I'll post the stacktrace in the thread.
$ bb bar
Sat 14 May 2022 01:22:39 PM EDT
#error {
:cause "Socket closed"
:via
[{:type java.net.SocketException
:message "Socket closed"
:at [com.oracle.svm.jni.JNIJavaCallWrappers jniInvoke_ARRAY_SocketException_constructor_df417f52c09624a386e25e5af85993f853394076 "JNIJavaCallWrappers.java" 0]}]
:trace
[[com.oracle.svm.jni.JNIJavaCallWrappers jniInvoke_ARRAY_SocketException_constructor_df417f52c09624a386e25e5af85993f853394076 "JNIJavaCallWrappers.java" 0]
[com.oracle.svm.jni.functions.JNIFunctions$NewObjectWithObjectArrayArgFunctionPointer invoke "JNIFunctions.java" -1]
[com.oracle.svm.jni.functions.JNIFunctions ThrowNew "JNIFunctions.java" 891]
[java.net.SocketInputStream socketRead0 "SocketInputStream.java" -1]
[java.net.SocketInputStream socketRead "SocketInputStream.java" 115]
[java.net.SocketInputStream read "SocketInputStream.java" 168]
[java.net.SocketInputStream read "SocketInputStream.java" 140]
[java.net.SocketInputStream read "SocketInputStream.java" 200]
[java.io.FilterInputStream read "FilterInputStream.java" 83]
[java.io.PushbackInputStream read "PushbackInputStream.java" 136]
[bencode.core$read_byte invokeStatic "core.clj" 86]
[bencode.core$read_token invokeStatic "core.clj" 236]
[bencode.core$read_bencode invokeStatic "core.clj" 253]
[babashka.pods.impl$read invokeStatic "impl.clj" 25]
[babashka.pods.impl$processor$fn__30750 invoke "impl.clj" 169]
[babashka.pods.impl$processor invokeStatic "impl.clj" 169]
[babashka.pods.sci$load_pod$fn__30923 invoke "sci.clj" 119]
[sci.impl.vars$binding_conveyor_fn$fn__343 invoke "vars.cljc" 154]
[clojure.core$binding_conveyor_fn$fn__5823 invoke "core.clj" 2047]
[clojure.lang.AFn call "AFn.java" 18]
[java.util.concurrent.FutureTask run "FutureTask.java" 264]
[java.util.concurrent.ThreadPoolExecutor runWorker "ThreadPoolExecutor.java" 1128]
[java.util.concurrent.ThreadPoolExecutor$Worker run "ThreadPoolExecutor.java" 628]
[java.lang.Thread run "Thread.java" 829]
[com.oracle.svm.core.thread.PlatformThreads threadStartRoutine "PlatformThreads.java" 704]
[com.oracle.svm.core.posix.thread.PosixPlatformThreads pthreadStartRoutine "PosixPlatformThreads.java" 202]]}
{:paths ["src/tasks"]
:pods {epiccastle/spire {:version "0.1.0-alpha.18"}}
:tasks
{:requires ([tasks]
[server]
[taoensso.timbre :as log]
[ :as io]
[babashka.process :as p :refer [process]])
...
bar (shell "date")
server:run-server server/run-server
server:bootstrap server/bootstrap
server:git-pull server/git-pull
server:deploy server/deploy
...
With this:
{:pods {epiccastle/spire {:version "0.1.0-alpha.18"}}
:tasks {bar (shell "date")}}
I get:
$ bb bar
Sat May 14 20:23:38 CEST 2022
I need a fuller repro, sinces you're loading tasks
and server
as well in your namespace and I'm not sure what happens there
you could try to remove those from :requires
and then execute bar and see if that works
Yes, it's definitely something in server. If I comment out the require for it, bar
always works. Even with just this file:
(ns server
(:require
[pod.epiccastle.spire.transport :as transport :refer [ssh]]))
I get the error.Is there some way to conditionally require pods, BTW? I don't need Spire for the majority of my tasks.
This does work for me:
{:pods {epiccastle/spire {:version "0.1.0-alpha.18"}}
:tasks {bar {:requires ([pod.epiccastle.spire.transport :refer [ssh]])
:task (clojure.repl/doc ssh)}}}
Does it also for you?That seems to consistently return:
$ bb bar
-------------------------
pod.epiccastle.spire.transport/ssh
([host-string & body])
Macro
It might be something with bb, I'm not sure. I just need a full repro to say with certainty.
Note that you need to load the pod first before you can do a require, if you do not declare the pod in bb.edn
you can read about that here: https://book.babashka.org/#pods
Thanks, will look into that. https://github.com/sheluchin/bb-spire-pod-repro Would you like a BB issue to go with this?
And in my case the error is consistent:
$ bb bar
Sat 14 May 2022 02:58:29 PM EDT
#error {
:cause "Socket closed"
:via
[{:type java.net.SocketException
:message "Socket closed"
:at [com.oracle.svm.jni.JNIJavaCallWrappers jniInvoke_ARRAY_SocketException_constructor_df417f52c09624a386e25e5af85993f853394076 "JNIJavaCallWrappers.java" 0]}]
:trace
[[com.oracle.svm.jni.JNIJavaCallWrappers jniInvoke_ARRAY_SocketException_constructor_df417f52c09624a386e25e5af85993f853394076 "JNIJavaCallWrappers.java" 0]
[com.oracle.svm.jni.functions.JNIFunctions$NewObjectWithObjectArrayArgFunctionPointer invoke "JNIFunctions.java" -1]
[com.oracle.svm.jni.functions.JNIFunctions ThrowNew "JNIFunctions.java" 891]
[java.net.SocketInputStream socketRead0 "SocketInputStream.java" -1]
[java.net.SocketInputStream socketRead "SocketInputStream.java" 115]
[java.net.SocketInputStream read "SocketInputStream.java" 168]
[java.net.SocketInputStream read "SocketInputStream.java" 140]
[java.net.SocketInputStream read "SocketInputStream.java" 200]
[java.io.FilterInputStream read "FilterInputStream.java" 83]
[java.io.PushbackInputStream read "PushbackInputStream.java" 136]
[bencode.core$read_byte invokeStatic "core.clj" 86]
[bencode.core$read_token invokeStatic "core.clj" 236]
[bencode.core$read_bencode invokeStatic "core.clj" 253]
[babashka.pods.impl$read invokeStatic "impl.clj" 25]
[babashka.pods.impl$processor$fn__30750 invoke "impl.clj" 169]
[babashka.pods.impl$processor invokeStatic "impl.clj" 169]
[babashka.pods.sci$load_pod$fn__30923 invoke "sci.clj" 119]
[sci.impl.vars$binding_conveyor_fn$fn__343 invoke "vars.cljc" 154]
[clojure.core$binding_conveyor_fn$fn__5823 invoke "core.clj" 2047]
[clojure.lang.AFn call "AFn.java" 18]
[java.util.concurrent.FutureTask run "FutureTask.java" 264]
[java.util.concurrent.ThreadPoolExecutor runWorker "ThreadPoolExecutor.java" 1128]
[java.util.concurrent.ThreadPoolExecutor$Worker run "ThreadPoolExecutor.java" 628]
[java.lang.Thread run "Thread.java" 829]
[com.oracle.svm.core.thread.PlatformThreads threadStartRoutine "PlatformThreads.java" 704]
[com.oracle.svm.core.posix.thread.PosixPlatformThreads pthreadStartRoutine "PosixPlatformThreads.java" 202]]}
The pod may have died after it has just been started, but unfortunately we don't see output about that
the exit code is 0 though, so I suspect it's a benign issue, although it's not very friendly to see this output
For me it seems to have gone from intermittent to consistent. I can't get it to not happen now.
Ok, I'd be happy to provide any additional info if it would help. Please let me know if there's anything I can add. Otherwise I'll just ignore the error for the time being.
I logged an issue here: https://github.com/babashka/pods/issues/49
@UPWHQK562 I pushed a fix to master now (hopefully). Can you test it once the build finishes (should be in 15 minutes from now)? You can install it with
bash <(curl ) --version 0.8.3-SNAPSHOT --dir .
$ while :; do ./bb bar; sleep 1; done
Mon 30 May 2022 06:21:24 AM EDT
Mon 30 May 2022 06:21:25 AM EDT
Mon 30 May 2022 06:21:27 AM EDT
Mon 30 May 2022 06:21:28 AM EDT
Mon 30 May 2022 06:21:29 AM EDT
Mon 30 May 2022 06:21:30 AM EDT
Mon 30 May 2022 06:21:32 AM EDT
Mon 30 May 2022 06:21:33 AM EDT
Mon 30 May 2022 06:21:34 AM EDT
Mon 30 May 2022 06:21:35 AM EDT
Mon 30 May 2022 06:21:37 AM EDT
Mon 30 May 2022 06:21:38 AM EDT
Mon 30 May 2022 06:21:39 AM EDT
Mon 30 May 2022 06:21:41 AM EDT
Looks good, @U04V15CAJ. By comparison using my current version throws up the "socket closed" warning almost every time.
Thanks very much!Simply catching the exception and concluding execution without rethrowing? I guess there's no value to it at all?
Normally we expected an EOFException, but with sockets it throws a different one which we hadn't covered