Commit Graph

8 Commits

Author SHA1 Message Date
Stein Magnus Jodal
c4940cbea2 autopep8: Add space after class signature/docstring 2015-04-03 00:05:26 +02:00
Thomas Adamcik
fa8547c397 tests: Add noqa markers for setUp/tearDown 2014-12-30 00:23:01 +01:00
Stein Magnus Jodal
496142c201 py3: Use absolute imports by default 2014-12-07 20:17:10 +01:00
Trygve Aaberge
15597b3c60 tests: Test call order in test_recv_callback_gets_no_data 2014-08-14 12:43:42 +02:00
Trygve Aaberge
265951bf00 network: disable_recv before telling actor to close connection
As of d62ad96, when the connection can't receive more data from the
client, it tells the actor to stop the connection and calls
disable_recv(). The actor operates in it's own thread and when it stops
the connection, disable_recv is being called again from a different
thread. Since the actor is told to stop the connection before
disable_recv is called, the two calls to disable_recv may happen
simultaneously.

This causes a race condition issue where both threads can reach past the
check that recv_id is not None before either of them set it to None. If
one of them set it to None before the other one tries to use it, an
error is raised.

This commit calls disable_recv before telling the actor to stop the
connection. Since disable_recv is a blocking call, this ensures that
recv_id is being set to None before the actor thread begins to stop the
connection.

Fixes #781
2014-08-14 01:58:48 +02:00
Stein Magnus Jodal
b754885064 Fix all import order warnings 2014-05-07 20:08:43 +02:00
Trygve Aaberge
d62ad966af network: Respond to messages before closing connections
This makes a connection tell the actor to stop the connection, instead
of stopping it itself. This is preferable, because other messages sent
to the actor that is not processed yet, may now send data to the client.

E.g. it makes this work:
$ echo status | nc localhost 6600
2014-04-25 06:11:01 +02:00
Stein Magnus Jodal
c781f77ef3 Rename test files to pattern expected by test runners 2014-01-15 00:01:50 +01:00