After upgrading to the newest datomic version we see in logs a huge amount of the next records:
Exception in thread "async-dispatch-22" java.lang.ClassCastException: class clojure.core.async.impl.ioc_macros$aset_object cannot be cast to class clojure.lang.IFn$OLOO (clojure.core.async.impl.ioc_macros$aset_object is in unnamed module of loader clojure.lang.DynamicClassLoader @164148d5; clojure.lang.IFn$OLOO is in unnamed module of loader 'app')
at datomic.future$add_bounding_warning$fn__12964$state_machine__6538__auto____12971.invoke(future.clj:86)
at datomic.future$add_bounding_warning$fn__12964.invoke(future.clj:86)
at clojure.lang.AFn.run(AFn.java:22)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at clojure.core.async.impl.concurrent$counted_thread_factory$reify__463$fn__464.invoke(concurrent.clj:29)
at clojure.lang.AFn.run(AFn.java:22)
at java.base/java.lang.Thread.run(Thread.java:840)
It looks like it doesn’t affect application functionality but logs are completely filled with similar records.
When datomic version is reverted then all becomes ok again
Datomic is used by Java application
OS: Ubuntu 23.10
My project depends only on peer library and does not declare a direct dependency on core.async. According to the gradpe dependency output, I see the latest version of core.async is used so most probably it is not the cause of the issue
This exception is coming out of a go macro in the peer library that was aot-compiled against clojure.core/async 1.6.681.
This exception:
class clojure.core.async.impl.ioc_macros$aset_object cannot be cast to class clojure.lang.IFn$OLOO
Indicates that the clojure.core.async.impl.ioc-macro/aset-object function exists, but does not have a ^long type hint on its second argument. The only core.async versions where that is true are those before this commit, which was first included in 1.6.673.
I do not know how, but it really looks like there are core.async classes on your application classpath from before version 1.6.673 of core-async.
Some things you can try:
Does your application have an aot build process? Could it have some stale classes from a previous build?
Does your application have an uberjar build process? Could it have stale classes or clj files from a previous build?
Could you dump the application classpath out of your tooling and ensure it has no core-async jars in it with the wrong version?
Could you run your application as a classpath-of-jars (vs a built artifact) and see if it still throws?
What is interesting is that the error appears from time to time, when I run the same jar sometimes I see the error, and sometimes the error is absent. According to the logs I see the error happens in a background process and does not affect the stability of the application but clogs the logs