NPE in MonitoredSockets.purgeEntriesOlderThan(..)
cheremin opened this issue · 4 comments
During long run I've seen traces like this:
Caused by: java.lang.NullPointerException
at com.lmax.angler.monitoring.network.monitor.socket.MonitoredSockets.purgeEntriesOlderThan(MonitoredSockets.java:60)
It takes time to trace the error down, and finally error seems to be in agrona LongHashSet.iterator() method:
public LongIterator iterator()
{
iterator.reset();
return iterator;
}
iterator.reset() is called with no-arg here, so .values array inside iterator is not updated, (only position reset), while LongHashSet.values is replaced on resize. This lead to configuration there iterator continue to use outdated .values array, which has nothing in common with actual LongHashSet.values
Newest versions of agrona (e.g. 0.9.6) does not have this bug in LongHashSet.iterator()
I will pick this up later in the week.
Ah sorry @cheremin I was aware of this problem with the older versions of agrona collections. Updating now to 0.9.6, will bump version & publish to maven once the travis build passes.
Fixed in 1.0.6, published to maven.