Skip to content

kz-dt/reactor_class_cast_exception_reproducer

Repository files navigation

Reproducer sample for Reactor 3.6+ and TracingLifter issue (ClassCastException)

This sample is created to demonstrate an issue that was found on SpringBoot 3.2+ reactive application and Couchbase java client 3.4.11. The issue is triggered by a get request to couchbase server. The sample is based on code from couchbase-jvm-client repo

To trigger the issue the following conditions must be fulfilled:

  • Hooks.enableAutomaticContextPropagation() must be called
  • a micrometer jar should be in class path
  • onEachOperator hook is set up and provided a function that sets up tracing lift operator.
  • a reactor-core 3.6+

Starting the sample:

  • Run ReactorClassCastExceptionReproducerSample.main(String[] args)

Expected behaviour

  • Sample throws no exception

Actual behaviour

  • java.lang.ClassCastException exception is thrown class reactor.core.publisher.FluxContextWriteRestoringThreadLocals$ContextWriteRestoringThreadLocalsSubscriber cannot be cast to class reactor.core.Fuseable$QueueSubscription

Notes

  • Calling Hooks.onOperatorDebug() "fixes" the problem, since lift is wrapped in another object.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages