When dumping the selector, we should take the keys only once, otherwise the set of keys may change between calls.
This commit is contained in:
parent
c0d3266c59
commit
6e38a97d7f
|
@ -24,6 +24,7 @@ import java.nio.channels.ServerSocketChannel;
|
|||
import java.nio.channels.SocketChannel;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
|
@ -969,8 +970,9 @@ public abstract class SelectorManager extends AbstractLifeCycle implements Dumpa
|
|||
public void dumpKeyState(List<Object> dumpto)
|
||||
{
|
||||
Selector selector=_selector;
|
||||
dumpto.add(selector+" keys="+selector.keys().size());
|
||||
for (SelectionKey key: selector.keys())
|
||||
Set<SelectionKey> keys = selector.keys();
|
||||
dumpto.add(selector + " keys=" + keys.size());
|
||||
for (SelectionKey key: keys)
|
||||
{
|
||||
if (key.isValid())
|
||||
dumpto.add(key.attachment()+" iOps="+key.interestOps()+" rOps="+key.readyOps());
|
||||
|
|
Loading…
Reference in New Issue