JavaNSQClient icon indicating copy to clipboard operation
JavaNSQClient copied to clipboard

ConcurrentModificationException in connect

Open tunesmith opened this issue 8 years ago • 0 comments

It looks like this code from NSQConsumer.java (around line 202) will sometimes throw a ConcurrentModificationException:

        for (final ServerAddress server : Sets.difference(oldAddresses, newAddresses)) {
            LogManager.getLogger(this).info("Remove connection " + server.toString());
            connections.get(server).close();
            connections.remove(server);
        }

Since the exception is uncaught, the scheduler.scheduleAtFixedRate then silently fails, which is bad.

tunesmith avatar Mar 04 '17 05:03 tunesmith