Open tsantor opened 7 years ago
I don't know what could be causing this; I haven't seen this assertion fire before. It could be a threading problem (Are you using multiple threads?), or it could be a windows-specific issue (can you reproduce this on linux?). Windows is not a fully-supported platform for Tornado so I'm afraid I won't be much help debugging if it turns out to be windows-specific.
Thanks for the response. I have never seen this issue occur when running under a Linux or a Unix (OS X) environment and it has run for countless hours under both without issue.
When you say that "Windows is not a fully-supported platform" can you enlighten me as to what specifically is not supported or is not stable when running under Windows? We've used Tornado successfully for TCP socket servers in the past on Windows without issue.
Also, are there any plans to officially support Windows?
"Not fully supported" means a couple of things. The big one is what you're seeing here: I don't run windows (nor does anyone else actively involved in tornado development as far as I know) and can't be much help with debugging. Windows users need to be more self-sufficient and debug their own problems. Second, Tornado on windows uses a POSIX-emulation layer that is less scalable and efficient than what we use on native posix platforms. Tornado on windows can only handle a few hundred connections per process (versus thousands or tens of thousands on linux) and it's much slower (the tornado test suite runs in 15 seconds on linux and several minutes on windows).
The first could be addressed by a volunteer who has (or could develop) the necessary expertise with windows networking. The second point is unlikely to change in Tornado; the POSIX-centric assumptions in the event loop design run deep (maybe after Tornado has dropped support for python 2 we could move towards using asyncio's windows-friendly interfaces). If windows is important for you, I would encourage you to look at using asyncio instead of tornado (note that while tornado can run on top of asyncio, doing so on windows requires running asyncio in a mode that doesn't address the performance or scalability issues here).
Thanks for the explanation. Windows is not usually our preferred deployment platform. We'd always prefer Linux. However, we were asked to put the server on Windows since the client can support the platform with their existing IT (Windows guys). We were not aware of any issues as we've run small scale Tornado servers in the past successfully. We also discovered first hand that a Tornado application will crash with anything over 510 TCP clients on Windows.
Looks like we're on our own in Windows land, but thanks for your time. We'll most likely recommend a move back to Linux and be done with it.
We are running a Tornado TCP server on a Windows server 2012 machine. This machine handles both an HTTP-based dashboard and 21 TCP Websocket connected clients. Occasionally in the logs we will see the following error. It seems to be at a very low level of the Websocket13 protocol. But from a networking standpoint what does it mean? Why would the write buffer not be greater than or equal to 0?