netty/netty — pull request #3149 by heinousjay (2014-11-18 20:43:40+00:00)
Title: check the bind future before writing DNS queries to the channel

Everything here applies against 5.0.0.Alpha2-SNAPSHOT in the master branch. This same problem probably occurs in other branches that include DNS resolution but I'm leaning pretty far forward in my use of netty right now.

I noticed that the DnsQueryContext, using the DatagramChannel bound in DnsNameResolver, blindly writes to the channel without checking the bind future for success. I have a fairly complicated test that reproduces errors around this problem, but I don't have a good reduction that I can attach here and the errors are timing dependent so I'm not even certain they'll reproduce outside of my machine.

This request just fixes the bug, I'm working to understand enough about this code to write a good test for my changes.