question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Lots of 'ConcurrentModificationException: null' since upgrading to 1.5.3

See original GitHub issue

Since upgrading micrometer to 1.5.3, we’re seeing load of these exceptions in our logs with warning message Error while discarding collection, stopping. This has already been mentioned in https://github.com/micrometer-metrics/micrometer/issues/2140#issuecomment-663004911 but figured I’d create a separate ticket for it.

Environment:

  • Java 11
  • Spring Boot 2.3
  • Micrometer 1.5.3
  • Using statsd
java.util.ConcurrentModificationException: null
	at java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1042)
	at java.base/java.util.ArrayList$Itr.next(ArrayList.java:996)
	at io.micrometer.shaded.reactor.core.publisher.Operators.onDiscardMultiple(Operators.java:565)
	at io.micrometer.shaded.reactor.core.publisher.FluxBufferPredicate$BufferPredicateSubscriber.cancel(FluxBufferPredicate.java:174)
	at io.micrometer.shaded.reactor.core.publisher.FluxMap$MapSubscriber.cancel(FluxMap.java:160)
	at io.micrometer.shaded.reactor.core.publisher.FluxOnBackpressureLatest$LatestSubscriber.cancel(FluxOnBackpressureLatest.java:99)
	at io.micrometer.shaded.reactor.core.publisher.FluxMap$MapSubscriber.cancel(FluxMap.java:160)
	at io.micrometer.shaded.reactor.core.publisher.Operators.terminate(Operators.java:1222)
	at io.micrometer.shaded.reactor.netty.channel.MonoSendMany$SendManyInner.operationComplete(MonoSendMany.java:264)
	at io.micrometer.shaded.reactor.netty.channel.MonoSendMany$SendManyInner.operationComplete(MonoSendMany.java:114)
	at io.micrometer.shaded.io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:577)
	at io.micrometer.shaded.io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:551)
	at io.micrometer.shaded.io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:490)
	at io.micrometer.shaded.io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:615)
	at io.micrometer.shaded.io.netty.util.concurrent.DefaultPromise.setSuccess0(DefaultPromise.java:604)
	at io.micrometer.shaded.io.netty.util.concurrent.DefaultPromise.trySuccess(DefaultPromise.java:104)
	at io.micrometer.shaded.io.netty.channel.DefaultChannelPromise.trySuccess(DefaultChannelPromise.java:84)
	at io.micrometer.shaded.io.netty.channel.AbstractChannel$CloseFuture.setClosed(AbstractChannel.java:1158)
	at io.micrometer.shaded.io.netty.channel.AbstractChannel$AbstractUnsafe.doClose0(AbstractChannel.java:760)
	at io.micrometer.shaded.io.netty.channel.AbstractChannel$AbstractUnsafe.close(AbstractChannel.java:736)
	at io.micrometer.shaded.io.netty.channel.AbstractChannel$AbstractUnsafe.close(AbstractChannel.java:607)
	at io.micrometer.shaded.io.netty.channel.DefaultChannelPipeline$HeadContext.close(DefaultChannelPipeline.java:1352)
	at io.micrometer.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeClose(AbstractChannelHandlerContext.java:622)
	at io.micrometer.shaded.io.netty.channel.AbstractChannelHandlerContext.close(AbstractChannelHandlerContext.java:606)
	at io.micrometer.shaded.io.netty.channel.AbstractChannelHandlerContext.close(AbstractChannelHandlerContext.java:472)
	at io.micrometer.shaded.io.netty.channel.DefaultChannelPipeline.close(DefaultChannelPipeline.java:957)
	at io.micrometer.shaded.io.netty.channel.AbstractChannel.close(AbstractChannel.java:232)
	at io.micrometer.shaded.reactor.netty.DisposableChannel.dispose(DisposableChannel.java:76)
	at io.micrometer.shaded.reactor.netty.channel.ChannelOperations.dispose(ChannelOperations.java:168)
	at io.micrometer.shaded.reactor.core.Disposables.set(Disposables.java:421)
	at io.micrometer.shaded.reactor.core.Disposables$SwapDisposable.update(Disposables.java:317)
	at io.micrometer.statsd.StatsdMeterRegistry.lambda$retryReplaceClient$12(StatsdMeterRegistry.java:273)
	at io.micrometer.shaded.reactor.core.publisher.LambdaMonoSubscriber.onNext(LambdaMonoSubscriber.java:168)
	at io.micrometer.shaded.reactor.core.publisher.SerializedSubscriber.onNext(SerializedSubscriber.java:99)
	at io.micrometer.shaded.reactor.core.publisher.FluxRetryWhen$RetryWhenMainSubscriber.onNext(FluxRetryWhen.java:162)
	at io.micrometer.shaded.reactor.core.publisher.MonoCreate$DefaultMonoSink.success(MonoCreate.java:156)
	at io.micrometer.shaded.reactor.netty.resources.NewConnectionProvider$NewConnectionObserver.onStateChange(NewConnectionProvider.java:199)
	at io.micrometer.shaded.reactor.netty.channel.ChannelOperationsHandler.channelActive(ChannelOperationsHandler.java:65)
	at io.micrometer.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:230)
	at io.micrometer.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:216)
	at io.micrometer.shaded.io.netty.channel.AbstractChannelHandlerContext.fireChannelActive(AbstractChannelHandlerContext.java:209)
	at io.micrometer.shaded.io.netty.channel.DefaultChannelPipeline$HeadContext.channelActive(DefaultChannelPipeline.java:1398)
	at io.micrometer.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:230)
	at io.micrometer.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:216)
	at io.micrometer.shaded.io.netty.channel.DefaultChannelPipeline.fireChannelActive(DefaultChannelPipeline.java:895)
	at io.micrometer.shaded.io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.fulfillConnectPromise(AbstractNioChannel.java:305)
	at io.micrometer.shaded.io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.connect(AbstractNioChannel.java:249)
	at io.micrometer.shaded.io.netty.channel.DefaultChannelPipeline$HeadContext.connect(DefaultChannelPipeline.java:1342)
	at io.micrometer.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeConnect(AbstractChannelHandlerContext.java:548)
	at io.micrometer.shaded.io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChannelHandlerContext.java:533)
	at io.micrometer.shaded.io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChannelHandlerContext.java:517)
	at io.micrometer.shaded.io.netty.channel.DefaultChannelPipeline.connect(DefaultChannelPipeline.java:978)
	at io.micrometer.shaded.io.netty.channel.AbstractChannel.connect(AbstractChannel.java:253)
	at io.micrometer.shaded.io.netty.bootstrap.Bootstrap$3.run(Bootstrap.java:250)
	at io.micrometer.shaded.io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
	at io.micrometer.shaded.io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
	at io.micrometer.shaded.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
	at io.micrometer.shaded.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
	at io.micrometer.shaded.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.micrometer.shaded.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:834)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:10
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
kdamevincommented, Aug 14, 2020

I can confirm we don’t see that error anymore after bumping to 1.5.4. Thank you!

1reaction
shakuzencommented, Aug 13, 2020

I will close this with @garry-mcfly’s report that it’s no longer occurring. We are about to release 1.5.4. If users are still seeing this issue after upgrading, we can reopen this and investigate further.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ConcurrentModificationException in Java - Javatpoint
The ConcurrentModificationException occurs when an object is tried to be modified concurrently when it is not permissible. This exception usually comes when ...
Read more >
Fix the ConcurrentModificationException | TechTarget
Java's ConcurrentModificationException is thrown when a collection is modified while a Java Iterator is trying to loop through it.
Read more >
How to deal with ConcurrentModificationException in Java ...
One of the common problem while removing elements from an ArrayList in Java is the ConcurrentModificationException.
Read more >
[1.12.2] [SOLVED] ConcurrentModificationException
Hi there, I've got a small problem: I got back to my old source code and wanted to finish the GUI, thought for...
Read more >
How to avoid java.util.ConcurrentModificationException when ...
Every time you remove an element from the list, the elements after will be push forward. As long as you don't change elements...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found