twisted iocp reactor is still buggy---it was fixed on 23/10/2012

   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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值