`

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.

分享到:
评论

相关推荐

    Twisted-17.5.0-cp36-cp36m-win32.whl

    python3.6 爬虫 window 直接命令行安装 Twisted-17.5.0-cp36-cp36m-win32.whl python3.6 爬虫 window 直接命令行安装 Twisted-17.5.0-cp36-cp36m-win32.whl python3.6 爬虫 window 直接命令行安装 Twisted-17.5.0-...

    Twisted-19.2.1-cp37-cp37m-win_amd64(官方文件).zip

    描述中的 "Twisted-19.2.1-cp37-cp37m-win_amd64.whl 官方文件 官网下载太慢了" 指出压缩包内的主要文件是一个名为"Twisted-19.2.1-cp37-cp37m-win_amd64.whl"的Wheel文件,这是Python的一种二进制分发格式,方便...

    Twisted-17.9.0-cp35-cp35m-win_amd64.whl

    Twisted python3.5 Twisted python3.5 Twisted python3.5 Twisted python3.5 Twisted python3.5 Twisted-17.9.0-cp35-cp35m-win_amd64.whl Twisted-17.9.0-cp35-cp35m-win_amd64.whl Twisted-17.9.0-cp35-cp35m-win_...

    Twisted-19.7.0-cp37-cp37m-win_amd64.whl

    anaconda python3.7 twisted安装包Twisted-19.7.0-cp37-cp37m-win_amd64.whl

    Twisted-18.9.0-cp36-cp36m-win32.whl, Microsoft Visual C++ 14.0集成python用包

    解决Python3.6中安装y一些包时出现错误:error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools":...在包的放置路径下,执行pip install Twisted-18.9.0-cp36-cp36m-win32.whl

    Twisted-19.2.1-cp27-cp27m-win_amd64.whl

    Twisted-19.2.1-cp27-cp27m-win_amd64.whl,用于不想下载VC++14运行库,pipi install Twisted-19.2.1-cp27-cp27m-win_amd64.whl 直接安装

    Twisted-18.4.0-cp36-cp36m-win_amd64.whl

    Twisted-18.4.0-cp36-cp36m-win_amd64.whl 1.pip 安装scrapy报错: building 'twisted.test.raiser' extension error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": ...

    Twisted-17.1.0-cp35-cp35m-win32.whl

    python爬虫scrapy模块安装之前的必备模块Twisted-17.1.0-cp35-cp35m-win32.whl,此版本对应的是Twisted-17.1.0、python3.5、win32位 系统。

    Twisted-18.7.0-python3.6-3.7 32位和64位

    用于安装相关程序需使用Twisted的whl文件,适用于python3.6和3.7,32位和64位的系统都有,共4个文件打包一起,使用方法: 1、pip install wheel ...3、pip install Twisted-18.7.0-cp36-cp36m-win_amd64.whl

    Twisted-19.2.0-cp37-cp37m-win_amd64.whl

    Twisted-19.2.0-cp37-cp37m-win_amd64.whl,用于不想下载VC++14运行库,pipi install Twisted-19.2.0-cp37-cp37m-win_amd64.whl 直接安装

    Twisted-19.2.1-cp37-cp37m-win_amd64.whl

    Twisted- python3.7 Twisted-19.2.1-cp37-cp37m-win_amd64.whl

    Twisted-18.7.0-cp36-cp36m-win_amd64 python3.6+适用

    在这里,提供的 `Twisted-18.7.0-cp36-cp36m-win_amd64.whl` 文件是一个预编译的 wheel 包,专为 `Python 3.6` 和 `AMD64` 架构的 Windows 系统设计。使用它可以避免编译过程中的问题,直接通过 `pip` 安装: ```...

    Twisted-17.5.0-cp36-cp36m-win_amd64.whl

    python爬虫scrapy模块安装之前的必备模块Twisted-17.5.0-cp36-cp36m-win_amd64.whl,此版本对应的是Twisted-17.5.0、python3.6、win64位 系统。

    Twisted-18.7.0-cp37-cp37m-win_amd64.whl

    在Python 3.7环境下,我们可以通过安装"Twisted-18.7.0-cp37-cp37m-win_amd64.whl"这个特定版本的包来支持64位的Windows系统。 1. **Twisted框架的核心特性**: - **事件驱动编程**:Twisted基于异步事件模型,...

    Twisted-19.2.1-cp35-cp35m-win_amd64.whl

    Twisted-19.2.1-cp35-cp35m-win_amd64.whl,用于不想下载VC++14运行库,pipi install Twisted-19.2.1-cp35-cp35m-win_amd64.whl 直接安装

    Twisted-19.2.1-cp38-cp38m-win_amd64.whl

    Twisted-19.2.1-cp38-cp38m-win_amd64.whl,用于不想下载VC++14运行库,pipi install Twisted-19.2.1-cp38-cp38m-win_amd64.whl 直接安装

    Twisted-17.9.0-cp36-cp36m-win_amd64

    Twisted是用Python实现的基于事件驱动的网络引擎框架。Twisted诞生于2000年初,在当时的网络游戏开发者看来,无论他们使用哪种语言,手中都鲜有可兼顾扩展性及跨平台的网络库。Twisted的作者试图在当时现有的环境下...

    Python工具资源:Twisted-19.2.1-cp37-cp37m-win_amd64;Twisted-19.2.0-cp37-cp37m-win_amd

    标题中的“Twisted-19.2.1-cp37-cp37m-win_amd64”和“Twisted-19.2.0-cp27-cp27m-win_amd64”指的是Python的一个著名开源库——Twisted的两个不同版本。Twisted是一个用于网络编程的事件驱动的网络引擎,它为Python...

    Twisted-20.3.0-cp38-cp38

    解压缩后含有3.8python 32位和64位两个版本。...pip.exe install .\Twisted-20.3.0-cp38-cp38-win32.whl(32位) pip.exe install .\Twisted-20.3.0-cp38-cp38-win_amd64.whl(64位) 安装成功后再次安装scrapy 即可!

Global site tag (gtag.js) - Google Analytics