You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Delete All In Instrumentation config page throws error.
Create more than one instrumentation for an agent
Go to instrumentation page and click delete all.
The following error gets thrown on the screen....An error occurredhide stack traceorg.glowroot.common.repo.ConfigRepository$OptimisticLockExceptionat org.glowroot.central.repo.ConfigRepositoryImpl$15.updateAgentConfig(ConfigRepositoryImpl.java:799)at org.glowroot.central.repo.AgentConfigDao.update(AgentConfigDao.java:204)at org.glowroot.central.repo.ConfigRepositoryImpl.deleteInstrumentationConfigs(ConfigRepositoryImpl.java:783)at org.glowroot.ui.InstrumentationConfigJsonService.removeInstrumentationConfig(InstrumentationConfigJsonService.java:198)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:498)at org.glowroot.ui.CommonHandler.callMethod(CommonHandler.java:587)at org.glowroot.ui.CommonHandler.handleJsonServiceMappings(CommonHandler.java:331)at org.glowroot.ui.CommonHandler.handleRequest(CommonHandler.java:248)at org.glowroot.ui.CommonHandler.handle(CommonHandler.java:165)at org.glowroot.ui.HttpServerHandler.channelRead(HttpServerHandler.java:183)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:438)at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310)at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:284)at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:253)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926)at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:134)at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:644)at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:579)at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:496)at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:458)at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)at java.lang.Thread.run(Thread.java:745)
--
Fix:
The culprit is these lines of code in ConfigRepositoryImpl.deleteInstrumentationConfigs
while (i.hasNext()) {
String currVersion = Versions.getVersion(i.next());
if (remainingVersions.contains(currVersion)) {
i.remove();
remainingVersions.remove(currVersion);
break;
}
}
if (!remainingVersions.isEmpty()) {
throw new OptimisticLockException();
}
If there are multiple instrumentations to be deleted the above loop exits after it finds the first one and does not remove the others and hence throws OptimisticLockException in subsequent lines of code.
Just remove the break statement will fix it.
The text was updated successfully, but these errors were encountered:
pavanie
changed the title
Delete All for instrumentation config for an agents when multiple instrumentations are defined throws error
Delete All for instrumentation config for an agent when multiple instrumentations are defined throws error
Oct 12, 2017
Delete All In Instrumentation config page throws error.
The following error gets thrown on the screen....An error occurredhide stack traceorg.glowroot.common.repo.ConfigRepository$OptimisticLockExceptionat org.glowroot.central.repo.ConfigRepositoryImpl$15.updateAgentConfig(ConfigRepositoryImpl.java:799)at org.glowroot.central.repo.AgentConfigDao.update(AgentConfigDao.java:204)at org.glowroot.central.repo.ConfigRepositoryImpl.deleteInstrumentationConfigs(ConfigRepositoryImpl.java:783)at org.glowroot.ui.InstrumentationConfigJsonService.removeInstrumentationConfig(InstrumentationConfigJsonService.java:198)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:498)at org.glowroot.ui.CommonHandler.callMethod(CommonHandler.java:587)at org.glowroot.ui.CommonHandler.handleJsonServiceMappings(CommonHandler.java:331)at org.glowroot.ui.CommonHandler.handleRequest(CommonHandler.java:248)at org.glowroot.ui.CommonHandler.handle(CommonHandler.java:165)at org.glowroot.ui.HttpServerHandler.channelRead(HttpServerHandler.java:183)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:438)at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310)at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:284)at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:253)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926)at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:134)at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:644)at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:579)at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:496)at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:458)at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)at java.lang.Thread.run(Thread.java:745)
--
Fix:
The culprit is these lines of code in ConfigRepositoryImpl.deleteInstrumentationConfigs
If there are multiple instrumentations to be deleted the above loop exits after it finds the first one and does not remove the others and hence throws OptimisticLockException in subsequent lines of code.
Just remove the break statement will fix it.
The text was updated successfully, but these errors were encountered: