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

[kamon-kafka] Instrumentation crashes on kafka-clients 2.5.0 #828

Closed
mladens opened this issue Aug 10, 2020 · 1 comment
Closed

[kamon-kafka] Instrumentation crashes on kafka-clients 2.5.0 #828

mladens opened this issue Aug 10, 2020 · 1 comment
Labels

Comments

@mladens
Copy link
Contributor

mladens commented Aug 10, 2020

ConsumerInstrumentation relies on internal groupId: String field which got updated to an Option.

org.apache.kafka.clients.consumer.KafkaConsumer with message Cannot assign private final java.util.Optional org.apache.kafka.clients.consumer.KafkaConsumer.groupId to class java.lang.String. Class loader: sun.misc.Launcher$AppClassLoader@18b4aac2: java.lang.IllegalStateException: Cannot assign private final java.util.Optional org.apache.kafka.clients.consumer.KafkaConsumer.groupId to class java.lang.String
	at kanela.agent.libs.net.bytebuddy.asm.Advice$OffsetMapping$ForField.resolve(Advice.java:2143)
	at kanela.agent.libs.net.bytebuddy.asm.Advice$Dispatcher$Inlining$Resolved$ForMethodExit.doApply(Advice.java:8291)
	at kanela.agent.libs.net.bytebuddy.asm.Advice$Dispatcher$Inlining$Resolved$ForMethodExit.apply(Advice.java:8252)
	```
@lvitaly
Copy link

lvitaly commented Aug 21, 2020

The same issue with kafka-clients 2.6

Error => org.apache.kafka.clients.consumer.KafkaConsumer with message Cannot assign private final java.util.Optional org.apache.kafka.clients.consumer.KafkaConsumer.groupId to class java.lang.String. Class loader: jdk.internal.loader.ClassLoaders$AppClassLoader@42a57993: java.lang.IllegalStateException: Cannot assign private final java.util.Optional org.apache.kafka.clients.consumer.KafkaConsumer.groupId to class java.lang.String
  at kanela.agent.libs.net.bytebuddy.asm.Advice$OffsetMapping$ForField.resolve(Advice.java:2143)
  at kanela.agent.libs.net.bytebuddy.asm.Advice$Dispatcher$Inlining$Resolved$ForMethodExit.doApply(Advice.java:8291)
  at kanela.agent.libs.net.bytebuddy.asm.Advice$Dispatcher$Inlining$Resolved$ForMethodExit.apply(Advice.java:8252)
  at kanela.agent.libs.net.bytebuddy.asm.Advice$Dispatcher$Inlining$Resolved$AdviceMethodInliner.visitMethod(Advice.java:7711)
  at kanela.agent.libs.net.bytebuddy.jar.asm.ClassReader.readMethod(ClassReader.java:1327)
  at kanela.agent.libs.net.bytebuddy.jar.asm.ClassReader.accept(ClassReader.java:718)
  at kanela.agent.libs.net.bytebuddy.jar.asm.ClassReader.accept(ClassReader.java:401)
  at kanela.agent.libs.net.bytebuddy.asm.Advice$Dispatcher$Inlining$Resolved$AdviceMethodInliner.apply(Advice.java:7705)
  at kanela.agent.libs.net.bytebuddy.asm.Advice$AdviceVisitor$WithExitAdvice.onUserEnd(Advice.java:10110)
  at kanela.agent.libs.net.bytebuddy.asm.Advice$AdviceVisitor.visitMaxs(Advice.java:9890)
  at kanela.agent.libs.net.bytebuddy.jar.asm.ClassReader.readCode(ClassReader.java:2636)
  at kanela.agent.libs.net.bytebuddy.jar.asm.ClassReader.readMethod(ClassReader.java:1488)
  at kanela.agent.libs.net.bytebuddy.jar.asm.ClassReader.accept(ClassReader.java:718)
  at kanela.agent.libs.net.bytebuddy.jar.asm.ClassReader.accept(ClassReader.java:401)
  at kanela.agent.libs.net.bytebuddy.dynamic.scaffold.TypeWriter$Default$ForInlining.create(TypeWriter.java:3827)
  at kanela.agent.libs.net.bytebuddy.dynamic.scaffold.TypeWriter$Default.make(TypeWriter.java:2166)
  at kanela.agent.libs.net.bytebuddy.dynamic.scaffold.inline.RebaseDynamicTypeBuilder.make(RebaseDynamicTypeBuilder.java:252)
  at kanela.agent.libs.net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.doTransform(AgentBuilder.java:10327)
  at kanela.agent.libs.net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.transform(AgentBuilder.java:10263)
  at kanela.agent.libs.net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.access$1600(AgentBuilder.java:10029)
  at kanela.agent.libs.net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer$Java9CapableVmDispatcher.run(AgentBuilder.java:10722)
  at kanela.agent.libs.net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer$Java9CapableVmDispatcher.run(AgentBuilder.java:10660)
  at java.base/java.security.AccessController.doPrivileged(Native Method)
  at kanela.agent.libs.net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.transform(AgentBuilder.java:10219)
  at kanela.agent.libs.net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer$ByteBuddy$ModuleSupport.transform(Unknown Source)
  at java.instrument/sun.instrument.TransformerManager.transform(TransformerManager.java:188)
  at java.instrument/sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:563)
  at java.base/java.lang.ClassLoader.defineClass1(Native Method)
  at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
  at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
  at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:800)
  at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:698)
  at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:621)
  at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:579)
  at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
  at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
  at org.apache.kafka.streams.processor.internals.DefaultKafkaClientSupplier.getRestoreConsumer(DefaultKafkaClientSupplier.java:56)
  at org.apache.kafka.streams.processor.internals.StreamThread.create(StreamThread.java:304)
  at org.apache.kafka.streams.KafkaStreams.<init>(KafkaStreams.java:772)
  at org.apache.kafka.streams.KafkaStreams.<init>(KafkaStreams.java:583)
  ...
  at zio.internal.FiberContext.evaluateNow(FiberContext.scala:360)
  at zio.internal.FiberContext.$anonfun$fork$15(FiberContext.scala:770)
  at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
  at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
  at java.base/java.lang.Thread.run(Thread.java:834)

ivantopo added a commit that referenced this issue Aug 26, 2020
+ kamon-kafka: add kafka clients 2.5 and 2.6 support and fixes #828
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants