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.

When proxy startup is complete throw ConcurrentModificationException

See original GitHub issue

Bug Report

Which version of ShardingSphere did you use?

master

Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?

ShardingSphere-Proxy

Expected behavior

Normal start

Actual behavior

Throw exception after startup

Reason analyze (If you can)

[ERROR] 2022-05-18 10:47:51.113 [Curator-SafeNotifyService-0] c.g.common.eventbus.EventBus.default - Exception thrown by subscriber method renew(org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.compute.event.XaRecoveryIdEvent) on subscriber org.apache.shardingsphere.mode.manager.cluster.coordinator.ClusterContextManagerCoordinator@4f1fb828 when dispatching event: org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.compute.event.XaRecoveryIdEvent@2b12ab45 java.util.ConcurrentModificationException: null at java.util.HashMap$HashIterator.nextNode(HashMap.java:1445) at java.util.HashMap$EntryIterator.next(HashMap.java:1479) at java.util.HashMap$EntryIterator.next(HashMap.java:1477) at org.apache.shardingsphere.mode.manager.ContextManager.renewAllTransactionContext(ContextManager.java:602) at org.apache.shardingsphere.mode.manager.cluster.coordinator.ClusterContextManagerCoordinator.renew(ClusterContextManagerCoordinator.java:256) 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 com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:87) at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:144) at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:72) at com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:30) at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:67) at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:108) at com.google.common.eventbus.EventBus.post(EventBus.java:212) at java.util.Optional.ifPresent(Optional.java:159) at org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.GovernanceWatcherFactory.lambda$watch$0(GovernanceWatcherFactory.java:55) at org.apache.shardingsphere.mode.repository.cluster.zookeeper.CuratorZookeeperRepository.lambda$watch$0(CuratorZookeeperRepository.java:240) at org.apache.curator.framework.recipes.cache.TreeCacheListenerWrapper.sendEvent(TreeCacheListenerWrapper.java:71) at org.apache.curator.framework.recipes.cache.TreeCacheListenerWrapper.event(TreeCacheListenerWrapper.java:42) at org.apache.curator.framework.recipes.cache.CuratorCacheListenerBuilderImpl$2.lambda$event$0(CuratorCacheListenerBuilderImpl.java:149) at java.util.ArrayList.forEach(ArrayList.java:1257) at org.apache.curator.framework.recipes.cache.CuratorCacheListenerBuilderImpl$2.event(CuratorCacheListenerBuilderImpl.java:149) at org.apache.curator.framework.recipes.cache.CuratorCacheImpl.lambda$putStorage$7(CuratorCacheImpl.java:279) at org.apache.curator.framework.listen.MappingListenerManager.lambda$forEach$0(MappingListenerManager.java:92) at org.apache.curator.framework.listen.MappingListenerManager.forEach(MappingListenerManager.java:89) at org.apache.curator.framework.listen.StandardListenerManager.forEach(StandardListenerManager.java:89) at org.apache.curator.framework.recipes.cache.CuratorCacheImpl.lambda$callListeners$10(CuratorCacheImpl.java:293) at java.util.concurrent.CompletableFuture$AsyncRun.run$$$capture(CompletableFuture.java:1640) at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.

I only configured server.yaml

`mode: type: Cluster repository: type: ZooKeeper props: namespace: pulsar server-lists: xxx:2181 retryIntervalMilliseconds: 500 timeToLiveSeconds: 60 maxRetries: 3 operationTimeoutMilliseconds: 500 overwrite: false

rules:

  • !AUTHORITY users:
    • root@%:root
    • sharding@:sharding provider: type: ALL_PERMITTED `

Example codes for reproduce this issue (such as a github link).

Pull the master code and modify the server.xml

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:12 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
github-actions[bot]commented, Oct 8, 2022

Hello , this issue has not received a reply for several days. This issue is supposed to be closed.

0reactions
zhaojinchao95commented, Nov 21, 2022

This problem cannot be reproduced. I close it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ConcurrentModificationException in Java - Javatpoint
This message says that the exception is thrown when the next method is called as the iterator is iterating the list and we...
Read more >
ConcurrentModificationException on JPA hibernate save ...
First, You are using an iterator and trying to modify the object contents and save them. Use ListIterator which allows setting modified values ......
Read more >
Guide to ConcurrentModificationException in Java - Medium
The name ConcurrentModificationException may sound related to concurrency, however, the exception can be thrown while a single thread operates on a map.
Read more >
How to Avoid the Concurrent Modification Exception in Java
This exception occurs when an object is attempted to be modified concurrently without permission. For example, if a Collection is modified while ...
Read more >
Current owner: [java.io.WinNTFileSystem.list(Native Method ...
ProxyFileManager.list(ProxyFileManager.java:189), com.sun.tools.javac.jvm. ... ClassReader$1.complete(ClassReader.java:244), com.sun.tools.javac.code.
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