Merge pull request #411 from iamqizhao/master

Improve rpc cancellation when there is no pending I/O