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

RestClient and Opentracing runs into StackOverflowError #3145

Closed
ennishol opened this issue Sep 30, 2021 · 2 comments
Closed

RestClient and Opentracing runs into StackOverflowError #3145

ennishol opened this issue Sep 30, 2021 · 2 comments

Comments

@ennishol
Copy link

ennishol commented Sep 30, 2021

I have a project with RestClient and open tracing with jaeger

@RegisterRestClient(configKey = "service.client")
@Produces("application/json")
@Consumes("application/json")
@ClientHeaderParam(name="User", value="VAL")
@RegisterProvider(ServiceExceptionMapper.class)
@ApplicationScoped
public interface ServiceRestClient {

    @POST
    @Path("/id/{id}")
    Response getResponse(@PathParam("id") Long id) throws Exception;
}

when the code is executed it runs into StackOverflowError:

15:55:35 ERROR [co.so.qu.ba.pr.MyserviceClient] (Camel (camel-1) thread #30 - seda://api) failed {}: java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.jboss.resteasy.microprofile.client.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:146)
	at jdk.proxy4/jdk.proxy4.$Proxy69.getResponse(Unknown Source)
	at com.company.Myservice.job.processor.MyserviceRestClient_169c6719a7819fcf303cc94bf22cf3e8922e01dc_Synthetic_ClientProxy.getResponse(MyserviceRestClient_169c6719a7819fcf303cc94bf22cf3e8922e01dc_Synthetic_ClientProxy.zig:120)
	at com.company.Myservice.job.processor.MyserviceClient.getApiResponse(MyserviceClient.java:58)
	at com.company.Myservice.job.processor.MyserviceClient.getResult(MyserviceClient.java:42)
	at com.company.Myservice.job.processor.MyserviceClient_Subclass.getResult$$superforward1(MyserviceClient_Subclass.zig:293)
	at com.company.Myservice.job.processor.MyserviceClient_Subclass$$function$$3.apply(MyserviceClient_Subclass$$function$$3.zig:43)
	at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:54)
	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.proceed(InvocationInterceptor.java:62)
	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.monitor(InvocationInterceptor.java:51)
	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor_Bean.intercept(InvocationInterceptor_Bean.zig:521)
	at io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:41)
	at io.quarkus.arc.impl.AroundInvokeInvocationContext.perform(AroundInvokeInvocationContext.java:41)
	at io.quarkus.arc.impl.InvocationContexts.performAroundInvoke(InvocationContexts.java:32)
	at com.company.Myservice.job.processor.MyserviceClient_Subclass.getResult(MyserviceClient_Subclass.zig:605)
	at com.company.Myservice.job.processor.MyserviceClient_ClientProxy.getResult(MyserviceClient_ClientProxy.zig:131)
	at com.company.Myservice.job.BaseReportRoute.getCalculationResult(BaseReportRoute.java:301)
	at com.company.Myservice.job.Executor_Subclass.getCalculationResult$$superforward1(Executor_Subclass.zig:5837)
	at com.company.Myservice.job.Executor_Subclass$$function$$27.apply(Executor_Subclass$$function$$27.zig:33)
	at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:54)
	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.proceed(InvocationInterceptor.java:62)
	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.monitor(InvocationInterceptor.java:51)
	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor_Bean.intercept(InvocationInterceptor_Bean.zig:521)
	at io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:41)
	at io.quarkus.arc.impl.AroundInvokeInvocationContext.perform(AroundInvokeInvocationContext.java:41)
	at io.quarkus.arc.impl.InvocationContexts.performAroundInvoke(InvocationContexts.java:32)
	at com.company.Myservice.job.Executor_Subclass.getCalculationResult(Executor_Subclass.zig:10830)
	at org.apache.camel.builder.ExpressionClause$5.evaluate(ExpressionClause.java:157)
	at org.apache.camel.support.ExpressionAdapter.evaluate(ExpressionAdapter.java:45)
	at org.apache.camel.builder.ExpressionClause.evaluate(ExpressionClause.java:1035)
	at org.apache.camel.processor.TransformProcessor.process(TransformProcessor.java:47)
	at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.doRun(RedeliveryErrorHandler.java:804)
	at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.run(RedeliveryErrorHandler.java:712)
	at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:179)
	at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:64)
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:184)
	at org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:398)
	at org.apache.camel.component.seda.SedaConsumer.sendToConsumers(SedaConsumer.java:269)
	at org.apache.camel.component.seda.SedaConsumer.doRun(SedaConsumer.java:187)
	at org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:130)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.StackOverflowError
	at io.quarkus.arc.impl.ClientProxies.getApplicationScopedDelegate(ClientProxies.java:15)
	at io.quarkus.smallrye.opentracing.runtime.TracerProducer_ProducerMethod_tracer_96dadb3d6afa0cccadfe742c3e06ad433737c844_ClientProxy.arc$delegate(TracerProducer_ProducerMethod_tracer_96dadb3d6afa0cccadfe742c3e06ad433737c844_ClientProxy.zig:68)
	at io.quarkus.smallrye.opentracing.runtime.TracerProducer_ProducerMethod_tracer_96dadb3d6afa0cccadfe742c3e06ad433737c844_ClientProxy.activeSpan(TracerProducer_ProducerMethod_tracer_96dadb3d6afa0cccadfe742c3e06ad433737c844_ClientProxy.zig:152)
	at io.opentracing.util.GlobalTracer.activeSpan(GlobalTracer.java:209)
	at io.quarkus.smallrye.opentracing.runtime.TracerProducer_ProducerMethod_tracer_96dadb3d6afa0cccadfe742c3e06ad433737c844_ClientProxy.activeSpan(TracerProducer_ProducerMethod_tracer_96dadb3d6afa0cccadfe742c3e06ad433737c844_ClientProxy.zig:154)
	at io.opentracing.util.GlobalTracer.activeSpan(GlobalTracer.java:209)
	at io.quarkus.smallrye.opentracing.runtime.TracerProducer_ProducerMethod_tracer_96dadb3d6afa0cccadfe742c3e06ad433737c844_ClientProxy.activeSpan(TracerProducer_ProducerMethod_tracer_96dadb3d6afa0cccadfe742c3e06ad433737c844_ClientProxy.zig:154)
	at io.opentracing.util.GlobalTracer.activeSpan(GlobalTracer.java:209)
	at io.quarkus.smallrye.opentracing.runtime.TracerProducer_ProducerMethod_tracer_96dadb3d6afa0cccadfe742c3e06ad433737c844_ClientProxy.activeSpan(TracerProducer_ProducerMethod_tracer_96dadb3d6afa0cccadfe742c3e06ad433737c844_ClientProxy.zig:154)
	at io.opentracing.util.GlobalTracer.activeSpan(GlobalTracer.java:209)
	at io.quarkus.smallrye.opentracing.runtime.TracerProducer_ProducerMethod_tracer_96dadb3d6afa0cccadfe742c3e06ad433737c844_ClientProxy.activeSpan(TracerProducer_ProducerMethod_tracer_96dadb3d6afa0cccadfe742c3e06ad433737c844_ClientProxy.zig:154)
	at io.opentracing.util.GlobalTracer.activeSpan(GlobalTracer.java:209)
	at io.quarkus.smallrye.opentracing.runtime.TracerProducer_ProducerMethod_tracer_96dadb3d6afa0cccadfe742c3e06ad433737c844_ClientProxy.activeSpan(TracerProducer_ProducerMethod_tracer_96dadb3d6afa0cccadfe742c3e06ad433737c844_ClientProxy.zig:154)
	at io.opentracing.util.GlobalTracer.activeSpan(GlobalTracer.java:209)
...
...

In debugger, I see that the failing span is for the POST method of the rest client. Unfortunately, I can't reproduce it in a smaller project, but maybe one could point me in the right direction?

@jamesnetherton
Copy link
Contributor

@ennishol Can you share an example application that demonstrates the problem?

@ennishol
Copy link
Author

ennishol commented Oct 1, 2021

@jamesnetherton It seems that the problem was related to Issue 3142 I added resteasy extension and the error is gone

@ennishol ennishol closed this as completed Oct 1, 2021
@ppalaga ppalaga added this to the No fix/wont't fix milestone Oct 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants