Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClassCastException when using Slick and Kamon Jdbc #1331

Open
alexmihailov opened this issue Mar 21, 2024 · 0 comments
Open

ClassCastException when using Slick and Kamon Jdbc #1331

alexmihailov opened this issue Mar 21, 2024 · 0 comments

Comments

@alexmihailov
Copy link
Contributor

Kamon version 2.6.1
Kanela version 1.0.17
Slick version 3.3.2

When using Slick and Kamon Jdbc with setting:
kanela.modules.executor-service-capture-on-submit setup.enabled = true

I get an exception:

java.lang.ClassCastException: class kamon.instrumentation.executor.CaptureContextOnSubmitInstrumentation$ContextAwareRunnable cannot be cast to class slick.util.AsyncExecutor$PrioritizedRunnable (kamon.instrumentation.executor.CaptureContextOnSubmitInstrumentation$ContextAwareRunnable and slick.util.AsyncExecutor$PrioritizedRunnable are in unnamed module of loader 'app')
	at slick.util.ManagedArrayBlockingQueue.offer(ManagedArrayBlockingQueue.scala:17)
	at java.base/java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1347)
	at slick.util.AsyncExecutor$$anon$1$$anon$4.execute(AsyncExecutor.scala:163)
	at scala.concurrent.impl.Promise$Transformation.submitWithValue(Promise.scala:429)
	at scala.concurrent.impl.Promise$DefaultPromise.submitWithValue(Promise.scala:338)
	at scala.concurrent.impl.Promise$DefaultPromise.dispatchOrAddCallbacks(Promise.scala:312)
	at scala.concurrent.impl.Promise$DefaultPromise.map(Promise.scala:182)
	at scala.concurrent.Future$.apply(Future.scala:678)
	at slick.jdbc.JdbcBackend$DatabaseDef.io(JdbcBackend.scala:65)

Also, to reproduce the error, it is necessary that HicariCP did not immediately process the tasks, but queued them by calling the java.util.concurrent method.BlockingQueue.offer(E).

I created an example in which I described the error in more detail and reproduced it - https://github.com/alexmihailov/kamon-slick-issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Selected
Development

No branches or pull requests

1 participant