Errors after upgrading to datomic pro 1.0.7180 from 1.0.7075

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

does your application maybe also depend on core.async? if yes, try to update it as well.

1 Like

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

|    +--- com.datomic:peer:1.0.7180
|    |    +--- org.clojure:clojure:1.9.0 -> 1.11.1
|    |    |    +--- org.clojure:spec.alpha:0.3.218
|    |    |    \--- org.clojure:core.specs.alpha:0.2.62
|    |    +--- org.clojure:core.async:1.6.681
|    |    |    +--- org.clojure:tools.analyzer.jvm:1.2.3
|    |    |    |    +--- org.clojure:tools.analyzer:1.1.1
|    |    |    |    |    \--- org.clojure:clojure:1.5.1 -> 1.11.1 (*)
|    |    |    |    +--- org.clojure:core.memoize:1.0.253
|    |    |    |    |    +--- org.clojure:core.cache:1.0.225
|    |    |    |    |    |    +--- org.clojure:data.priority-map:1.1.0
|    |    |    |    |    |    |    \--- org.clojure:clojure:1.5.1 -> 1.11.1 (*)
|    |    |    |    |    |    \--- org.clojure:clojure:1.6.0 -> 1.11.1 (*)
|    |    |    |    |    \--- org.clojure:clojure:1.6.0 -> 1.11.1 (*)
|    |    |    |    +--- org.ow2.asm:asm:9.2
|    |    |    |    +--- org.clojure:tools.reader:1.3.6
|    |    |    |    |    \--- org.clojure:clojure:1.5.1 -> 1.11.1 (*)
|    |    |    |    \--- org.clojure:clojure:1.5.1 -> 1.11.1 (*)
|    |    |    \--- org.clojure:clojure:1.10.0 -> 1.11.1 (*)
|    |    +--- org.clojure:tools.cli:1.0.219```

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?

Hi thank you for your response

  • it is a Java project built by Gradle where only datomic pro library has dependencies on clojure libraries
  • aot is not used
  • the screenshot below shows what is inside usebjar:

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