NOTE: I think I ran into this once as well and upped the timeouts or connection pool sizes in astyanax and it went away so try that as well(though connection reset is GENERALLY the far server's fault...ie. cassandra).
Sure connection reset is typically because the other end(cassandra) closed the connection on you. To be 100% sure, if you do a wireshark, you should see which end is closing the socket.
be careful what you read on this post here...
java.net.SocketException: Connection reset
but basically, I wrote channelmanager on sourceforge before mina, netty, etc. existed. Mostly, you get -1 when other end closes socket PROPERLY.....ie. they need to send some packets. IF they just dissappear, it can result in neat exceptions like Connection reset.
I suggest fiddling with the astyanax connection pool. Look at wireshark though and google how the tcp teardown happens and see if cassandra did not tear it down properly.
If you are on linux, try netstat -anp | grep {pid} so you can see ports that your client process is using and in wireshark look for packets on those. Also, do a test to make sure astyanax is keeping it's pool correctly in tact meaning run that netstat command a few times during the process to make sure astyanax is not creating sockets and then deleting them and creating them again(as if it deleted one and then you write to it, you could get the above error)
The java nio stuff was never completely reliable under the covers.....to this day, I still have unit tests demonstrating bugs in the nio libraries on different OS.
out of curiosity how much are you flushing down the pipe too as I notice you are doing a write and the read basically failed to get status on if write was successful or not.
In the coming months, we hope to have a generic map/reduce that feeds the map/reduce code the actual entities. We finally found and are sending an offer to a new developer that will join us soon to help with the workload.
Another good post to read is this
wireshark can really tell you the detail on what happened at the tcp layer. I have been meaning to look into more detail was it astyanax or cassandra's fault but have not had time.
Dean