Ok I will tell a little more about architecture used in the server:
When connection comes to server handler creates new task and adds in
to Dispatcher and one Thread then executes. (post and get handler
methods are marked with decorator @tornado.web.asynchronous)
After that thread class method in handler which encodes the message
end writes it with write method. Then it calls finish method.
Now if i'm not wrong finish (as this is part of tornado code) Firstly
it flushes, then calls HTTPRequest.finish then HTTPConnection.finish.
I'm not sure what happens is stream is still writting, but it not it
closes stream. This is why I told thread finishes connection. Other
IOLoop instances are created when they need to ask other servers for
information. I didn't see any Exception in logs.
I'm not sure when haproxy ends it's connection. I don't see anything
usefull in haproxy logs(we turned them on yestarday). So i'm possibly
wrong about that haproxy was first to end connection.
SIGSEGV maybe is just a symptom, but how this error only appears on
computers when we get SIGSEGV when closing server. That's strange for
me. I can reproduce this error on one of team members machines, but on
my machine it all works all the time. I ask myself where is the
diffrence between this machines, but i didn't find any visible
diffrence both use the same python version with the same libraries in
the same versions.
The error in first post is somehow just a part of the bigger problem.
On 11 Sty, 21:17, Ben Darnell <
b...@bendarnell.com> wrote:
> The SIGSEGV is likely a symptom rather than a cause of the underlying
> threading problem. How is another thread able to finish the connection?
> That sounds like the real problem. Normally in tornado when a connection
> is closed by the client or haproxy that event will get queued up in the
> IOLoop and handled in the usual thread.
>
> -Ben
>