core-async

ghaskins 2024-08-29T23:32:18.491409Z

Are there any known issues with either (alts!!) hanging or (timeout) not firing?

ghaskins 2024-08-30T12:23:03.043229Z

@hiredman https://github.com/protojure/lib/pull/167 Thanks for the help in diagnosing the problem

ghaskins 2024-08-29T23:33:03.253299Z

Im debugging an issue where https://github.com/protojure/lib/blob/76f51ccc7eaf7d6f7883f9634b2e5f37ef6d81b4/modules/io/src/protojure/internal/io.clj#L22 is hanging indefinitely despite there being an (async/timeout 5000) in the mix

ghaskins 2024-08-29T23:33:52.948899Z

The stack in case it is helpful

at java.util.concurrent.locks.LockSupport.park(java.base@22.0.1/LockSupport.java:221)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(java.base@22.0.1/AbstractQueuedSynchronizer.java:754)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(java.base@22.0.1/AbstractQueuedSynchronizer.java:1099)
	at java.util.concurrent.CountDownLatch.await(java.base@22.0.1/CountDownLatch.java:230)
	at clojure.core$promise$reify__8591.deref(core.clj:7178)
	at clojure.core$deref.invokeStatic(core.clj:2337)
	at clojure.core.async$fn__13371.invokeStatic(async.clj:312)
	at clojure.core.async$fn__13371.doInvoke(async.clj:303)
	at clojure.lang.RestFn.invoke(RestFn.java:410)
	at $is_rx.invokeStatic(io.clj:22)
	at $is_get_buffer.invokeStatic(io.clj:30)
	at $is_read.invokeStatic(io.clj:43)
	at $new_inputstream$reify__47382.read_offset(io.clj:63)
	at protojure.internal.io.ProxyInputStream.read(ProxyInputStream.java:31)
	at org.apache.commons.io.input.ProxyInputStream.read(ProxyInputStream.java:220)
	at org.apache.commons.io.input.BoundedInputStream.read(BoundedInputStream.java:478)

2024-08-29T23:38:49.052729Z

likely you are doing blocking operations in the dynamic extent of a go block, blocking up the threadpool used the service go blocks, causing callbacks from channels not being able to run, which causes timeouts to not appear to fire

2024-08-29T23:39:17.508269Z

like what is the name of the thread where you see that stacktrace?

ghaskins 2024-08-29T23:39:34.181549Z

@hiredman that makes total sense, because yes, that is my other problem (i stuff up the async thread pool)

ghaskins 2024-08-29T23:39:47.433729Z

I think I need to rethink this whole path

ghaskins 2024-08-29T23:39:55.827799Z

thank you for helping me to understand why