netty/netty — pull request #1155 by lucky (2013-03-13 22:20:39+00:00)
Title: Fix for Executors passed into NSSCF with fewer threads than needed

Fix for issue when a worker pool Executor with N threads where N is < than SelectorUtil.DEFAULT_IO_THREADS is passed into NioServerSocketChannelFactory
constructor.

We ran into this over the last few days, wasting two developer-days of debugging because we use a specialized ExecutorService factory that handles things like logging uncaught exceptions and whatnot.

The docs state ["It is the best bet to specify a cached thread pool."](http://docs.jboss.org/netty/3.2/api/org/jboss/netty/channel/socket/nio/NioServerSocketChannelFactory.html), but it did not describe what happens if you don't.

We passed in a worker executor with 8 threads, and since SelectorUtil.DEFAULT_IO_THREADS is 16 on our dev machines, the NioWorkers that were allocated never actually started. Their Runnables were submitted to the ExecutorService, but never run.