core-async

ghaskins 2024-01-18T14:33:02.929049Z

Is there any way to introspect/dump parked go routines?

Rachel Westmacott 2024-01-19T10:11:12.407819Z

I have got some info out of core-async in the past by either grabbing the stack traces

(for [[thread stack] (sort-by #(.getName (key %)) (Thread/getAllStackTraces))
        :when (str/starts-with? (.getName thread) "async-")]
    (let [top-frame (first stack)]
      [(str (.getState thread))
       (.getName thread)
       (count stack)
       (str (.getSimpleName (Class/forName (.getClassName ^StackTraceElement top-frame)))
            "."
            (.getMethodName ^StackTraceElement top-frame))]))
or by introspecting the buffers passed into the channels (which are countable iirc) to see which ones are full / empty. As for the go routines themselves, I've not pushed hard into those. I imagine that print statements or setting values into volatiles might be some ways to get information out of them, but of course it may (slightly) affect how the system runs.

Ben Sless 2024-01-18T15:57:01.541589Z

Flow Storm lets you debug go blocks and inspect their state. A bit haphazard but it works

👍 1
😲 2
ghadi 2024-01-18T15:23:02.081669Z

not yet

😁 1