EsotericSoftware / kryonet

TCP/UDP client/server library for Java, based on Kryo
BSD 3-Clause "New" or "Revised" License
1.82k stars 419 forks source link

ConcurrentModificationException upon disconnect of 3 or more Client #19

Closed ghost closed 10 years ago

ghost commented 10 years ago

From cimn...@gmail.com on May 01, 2012 11:20:21

What steps will reproduce the problem?

  1. I guess, that some clients are disconnecting at the same time. (It always happens upon the end of our game, when the players disconnect. Requires 3 or more connected players.) What is the expected output? What do you see instead? No CME ;-) What version of the product are you using? On what operating system? kryonet_1.04 Windows 7 x64 & OSX Lion Java7 (x64 & x32) & Java7u4 (x64 & x32) Please provide any additional information below. Exception in thread "ServerServiceContext" java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextEntry(HashMap.java:806) at java.util.HashMap$KeyIterator.next(HashMap.java:841) at com.esotericsoftware.kryonet.Server.update(Server.java:174) at com.esotericsoftware.kryonet.Server.run(Server.java:336) at ch.xxx.xxx.net.server.impl2.ServerServiceContext.run(ServerServiceContext.java:156) at com.google.common.util.concurrent.AbstractExecutionThreadService$1$1.run(AbstractExecutionThreadService.java:52) at java.lang.Thread.run(Thread.java:722)

Original issue: http://code.google.com/p/kryonet/issues/detail?id=18

ghost commented 10 years ago

From cimn...@gmail.com on May 01, 2012 02:22:07

Reproducible on Windows 7 x32, too

ghost commented 10 years ago

From nathan.s...@gmail.com on May 01, 2012 10:11:56

Can you make a reproducible test case? You could base it on one of the tests in SVN. This issue will be very hard to verify a fix without that.

ghost commented 10 years ago

From nathan.s...@gmail.com on May 23, 2012 15:56:50

The HashMap is in a synchronized block and this should not occur. Will address if I can reproduce.

Status: Invalid

ghost commented 10 years ago

From chrigim...@gmail.com on July 25, 2012 12:24:47

Sorry, I really wanted to provide an example, but I don't have time and we worked around it somehow.

Regards, Chris

Btw, you should mention somewhere, that for the AutoDiscovery to work, both, client and server, have to bind to the same UDP Port.