hi Jakub,
opened
https://java.net/jira/browse/JERSEY-1991
- I have very little experience with Jersey/HK2 internals ( or the public
APIs for that matter, heh ) so it might easily be a case of the PEBKAC
thanks,
Andras
On 26 July 2013 18:09, Jakub Podlesak <jakub.podlesak_at_oracle.com> wrote:
> Hi Andras,
>
> another slightly related issue was already filed for proxy injection (see
> [1]).
> Could you please go ahead and file a new bug report with a reproducible
> test case?
>
> Thanks,
>
> ~Jakub
>
> [1]https://java.net/jira/browse/JERSEY-1905
>
> On Jul 26, 2013, at 4:01 PM, Andras Szerdahelyi <
> andras.szerdahelyi_at_gmail.com> wrote:
>
> Hello list,
>
> while working on a Jersey container implementation for Netty 4 i noticed
> all threads of my Netty executor group ( running the Jersey handler i
> implemented ) are very often blocked on one of two methods in hk2's
> org.jvnet.hk2.internal.ServiceLocatorImpl ( resolveContext,
> internalGetDescriptor ) that both synchronise on the same lock.
>
> Has anyone experienced anything similar ?
> Here are the two stack traces i'm getting
>
>
>
> Stacks at 03:51:49 PM (uptime 7m 46s)
>
>
> defaultEventExecutorGroup-4-15 [BLOCKED] CPU time: 12s
> org.jvnet.hk2.internal.ServiceLocatorImpl.internalGetDescriptor(Injectee,
> Type, String, Unqualified, Annotation[])
> org.jvnet.hk2.internal.ServiceLocatorImpl.getService(Type, Annotation[])
> org.jvnet.hk2.internal.IterableProviderImpl.get()
>
> org.glassfish.jersey.server.internal.routing.MethodSelectingRouter.getMethodRouter(ContainerRequest)
> org.glassfish.jersey.server.internal.routing.MethodSelectingRouter.access$400(MethodSelectingRouter,
> ContainerRequest)
>
> org.glassfish.jersey.server.internal.routing.MethodSelectingRouter$4.apply(ContainerRequest)
>
> org.glassfish.jersey.server.internal.routing.MethodSelectingRouter.apply(ContainerRequest)
> org.glassfish.jersey.server.internal.routing.RoutingStage._apply(ContainerRequest,
> Router)<4 recursive calls>
>
> org.glassfish.jersey.server.internal.routing.RoutingStage.apply(ContainerRequest)
> org.glassfish.jersey.server.internal.routing.RoutingStage.apply(Object)
> org.glassfish.jersey.process.internal.Stages.process(Object, Stage, Ref)
> org.glassfish.jersey.server.ServerRuntime$1.run()
> org.glassfish.jersey.internal.Errors$1.call()<2 recursive calls>
> org.glassfish.jersey.internal.Errors.process(Callable, boolean)
> org.glassfish.jersey.internal.Errors.process(Producer, boolean)
> org.glassfish.jersey.internal.Errors.process(Runnable)
> org.glassfish.jersey.process.internal.RequestScope.runInScope(Runnable)
> org.glassfish.jersey.server.ServerRuntime.process(ContainerRequest)
> org.glassfish.jersey.server.ApplicationHandler.handle(ContainerRequest)
> andras.jersey.JerseyNettyHandler.channelRead0(ChannelHandlerContext,
> FullHttpRequest)
> andras.jersey.JerseyNettyHandler.channelRead0(ChannelHandlerContext,
> Object)
> io.netty.channel.SimpleChannelInboundHandler.channelRead(ChannelHandlerContext,
> Object)
> io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(Object)
> io.netty.channel.DefaultChannelHandlerContext.access$800(DefaultChannelHandlerContext,
> Object)
> io.netty.channel.DefaultChannelHandlerContext$9.run()
> io.netty.util.concurrent.DefaultEventExecutor.run()
> io.netty.util.concurrent.SingleThreadEventExecutor$2.run()
> java.lang.Thread.run()
>
>
>
> Stacks at 03:51:49 PM (uptime 7m 46s)
>
>
> defaultEventExecutorGroup-4-16 [BLOCKED] CPU time: 12s
> org.jvnet.hk2.internal.ServiceLocatorImpl.resolveContext(Class)
> org.jvnet.hk2.internal.Utilities.createService(ActiveDescriptor, Injectee,
> ServiceLocatorImpl, ServiceHandle, Class)
> org.jvnet.hk2.internal.ServiceLocatorImpl.getService(Type, Annotation[])
> org.jvnet.hk2.internal.IterableProviderImpl.get()
>
> org.glassfish.jersey.server.internal.routing.MethodSelectingRouter.getMethodRouter(ContainerRequest)
> org.glassfish.jersey.server.internal.routing.MethodSelectingRouter.access$400(MethodSelectingRouter,
> ContainerRequest)
>
> org.glassfish.jersey.server.internal.routing.MethodSelectingRouter$4.apply(ContainerRequest)
>
> org.glassfish.jersey.server.internal.routing.MethodSelectingRouter.apply(ContainerRequest)
> org.glassfish.jersey.server.internal.routing.RoutingStage._apply(ContainerRequest,
> Router)<4 recursive calls>
>
> org.glassfish.jersey.server.internal.routing.RoutingStage.apply(ContainerRequest)
> org.glassfish.jersey.server.internal.routing.RoutingStage.apply(Object)
> org.glassfish.jersey.process.internal.Stages.process(Object, Stage, Ref)
> org.glassfish.jersey.server.ServerRuntime$1.run()
> org.glassfish.jersey.internal.Errors$1.call()<2 recursive calls>
> org.glassfish.jersey.internal.Errors.process(Callable, boolean)
> org.glassfish.jersey.internal.Errors.process(Producer, boolean)
> org.glassfish.jersey.internal.Errors.process(Runnable)
> org.glassfish.jersey.process.internal.RequestScope.runInScope(Runnable)
> org.glassfish.jersey.server.ServerRuntime.process(ContainerRequest)
> org.glassfish.jersey.server.ApplicationHandler.handle(ContainerRequest)
> andras.jersey.JerseyNettyHandler.channelRead0(ChannelHandlerContext,
> FullHttpRequest)
> andras.jersey.JerseyNettyHandler.channelRead0(ChannelHandlerContext,
> Object)
> io.netty.channel.SimpleChannelInboundHandler.channelRead(ChannelHandlerContext,
> Object)
> io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(Object)
> io.netty.channel.DefaultChannelHandlerContext.access$800(DefaultChannelHandlerContext,
> Object)
> io.netty.channel.DefaultChannelHandlerContext$9.run()
> io.netty.util.concurrent.DefaultEventExecutor.run()
> io.netty.util.concurrent.SingleThreadEventExecutor$2.run()
> java.lang.Thread.run()
>
>
>
> All suggestions are greatly appreciated!
>
>
> thanks,
> Andras
>
>
>
>