I reported a bug on last weekend...This bug can be easily reproduced by sending continuous small chunks data. If we use pb or amp and send any data whose size can't fit the buffer (128K),
iocp reactor will raise a ERROR_IO_PENDING. and close the connection immediately. It looks like many write events are triggered instead of one.
two ways to work around:
1: increase the buffer limit.
2: don't try to send chunks data in a very short period...
after years development, iocp has been improved but not enough...comparing with other reactors like epoll,,,it is still experimental.
update: I have solved this bug. patch will be submitted soon.
This bug actually was triggered when SEND_LIMIT is reaching. IOCP may re schedule the writing operation which will lead to doWrite is called twice for the same data. When PB is unable to deserialize these bytes, it will simply close the connection and raise an exception.
What we need to do is to make sure doWrite being invoked in order. When the callback isn't invoked, we shouldn't call doWrite again.
I introduced an variable to solve this bug. now the test pass.
作者报告了一个在上周末发现的IOCP中的bug,该bug在发送连续小块数据时容易复现。当数据大小超出缓冲区限制(128K)时,会触发错误并立即关闭连接。作者提供了两种解决方案,并在后续更新中宣布已解决此问题,即将提交补丁。
2092

被折叠的 条评论
为什么被折叠?



