2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-23 14:57:06 +00:00
Commit Graph

21 Commits

Author SHA1 Message Date
Ben Pfaff
3a8d38c88e jsonrpc: Treat receiving part of a message as activity.
Until now, the jsonrpc code has only counted receiving a full JSON-RPC
messages as activity.  This could theoretically time out, then, while a
very long message is in transit or if a slow link is involved.  This commit
changes this code to count receiving any part of a message as activity.

This isn't a problem for OpenFlow connections because OpenFlow messages are
at most 64 kB in size.

This problem hasn't actually been observed in practice.

Bug #12789.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-09-07 10:50:21 -07:00
Ben Pfaff
f97cae2999 jsonrpc: Treat draining data from send queue as activity.
Until now, the jsonrpc module has used messages received from the
remote peer as the sole means to determine that the JSON-RPC
connection is up.  This could in theory interact badly with a
remote peer that stops reading and processing messages from the
receive queue when there is a backlog in the send queue for a
given connection (ovsdb-server is an example of a program that
behaves this way).  This commit fixes the problem by expanding
the definition of "activity" to include successfully sending
JSON-RPC data that was previously queued.

The above change is exactly analogous to the similar change
made to the rconn library in commit 133f2dc954 (rconn: Treat
draining a message from the send queue as activity.).

Bug #12789.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-09-07 10:50:15 -07:00
Ben Pfaff
a6f639f808 reconnect: Rename reconnect_received() to reconnect_activity().
Receiving data is not the only reasonable way to verify that a connection
is up.  For example, on a TCP connection, receiving an acknowledgment that
the remote side has accepted data that we sent is also a reasonable means.
Therefore, this commit generalizes the naming.

Also, similarly for the Python implementation: Reconnect.received() becomes
Reconnect.activity().

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-09-07 10:48:43 -07:00
Ben Pfaff
5796d9cf85 python: Call 'wait' methods correctly in jsonrpc and stream code.
Bug #12301.
Reported-by: Mike Kruze <mkruze@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-02 15:23:11 -07:00
Raju Subramanian
e0edde6fee Global replace of Nicira Networks.
Replaced all instances of Nicira Networks(, Inc) to Nicira, Inc.

Feature #10593
Signed-off-by: Raju Subramanian <rsubramanian@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-02 17:08:02 -07:00
Ethan Jackson
f1936eb651 stream: By default disable probing on unix sockets.
There isn't a lot of value in sending inactivity probes on unix
sockets.  This patch changes the default to disable them.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-04-12 00:43:22 -07:00
Ethan Jackson
ffc86c0db7 python: Add ovs_error() helper function to Python.
The ovs_error() and ovs_fatal() helper functions are useful enough
to be ported to Python.  A user will be added in a future commit.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-03-02 13:30:25 -08:00
Ethan Jackson
66eb76d0fc jsonrpc.py: Don't swallow errors in transact_block().
If a server returned an error in response to a request,
transact_block() would ignore it.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-03-02 13:30:25 -08:00
Ethan Jackson
3a656eafb9 python: Upgrade to vlog.
This patch upgrades the library code in the python/ovs directory to
the new vlog module.
2011-09-27 14:51:49 -07:00
Ethan Jackson
26bb0f3129 python: Style cleanup.
This patch does minor style cleanups to the code in the python and
tests directory.  There's other code floating around that could use
similar treatment, but updating it is not convenient at the moment.
2011-09-24 16:32:54 -07:00
Ben Pfaff
b2edc4e7d8 ovs.jsonrpc: Include result in Message.__str__() output.
This was overlooked in the initial implementation.  Including the result
member makes logging output more useful.
2011-09-23 09:10:44 -07:00
Ben Pfaff
9b46cccc33 python: Avoid shadowing standard or global names.
Found by pychecker.
2011-09-23 09:10:44 -07:00
Ben Pfaff
4071e24db4 ovs.jsonrpc: Fix static method Session.open() reference to 'self'.
Found by pychecker.
2011-08-25 11:07:23 -07:00
Ben Pfaff
b2a5856fef ovs.jsonrpc: Fix static method Message.__validate_arg reference to 'self'.
This method needs to be an instance method because it refers to 'self'.

Found by pychecker.
2011-08-25 11:07:23 -07:00
Ben Pfaff
63b1a52133 ovs.stream: Drop Stream.get_name() since clients can use 'name' directly.
Suggested-by: Reid Price <reid@nicira.com>
2011-08-24 12:06:53 -07:00
Ben Pfaff
2ad4ef8920 ovs.jsonrpc: Use "not X" in place of "len(X) == 0" for testing strings.
Suggested-by: Reid Price <reid@nicira.com>
2011-08-24 12:06:52 -07:00
Ben Pfaff
22bb61e9ee ovs.jsonrpc: Remove Connection.get_name()--clients can use 'name' directly.
Suggested-by: Reid Price <reid@nicira.com>
2011-08-24 12:06:52 -07:00
Ben Pfaff
17af143600 ovs.jsonrpc: Remove dead class variable Message.__next_id.
Reported-by: Reid Price <reid@nicira.com>
2011-08-24 12:06:52 -07:00
Ben Pfaff
8758e8a373 python: Avoid using 'type' as a variable name.
'type' is a Python built-in function, so it's best to avoid using it as
a variable name.

Reported-by: Reid Price <reid@nicira.com>
2011-08-24 11:57:42 -07:00
Justin Pettit
da51646f6f jsonrpc.py: Import "ovs.json".
Reported-by: Giuseppe de Candia <giuseppe.decandia@gmail.com>
2011-02-21 23:56:07 -08:00
Ben Pfaff
991559357f Implement initial Python bindings for Open vSwitch database.
These initial bindings pass a few hundred of the corresponding tests
for C implementations of various bits of the Open vSwitch library API.
The poorest part of them is actually the Python IDL interface in
ovs.db.idl, which has not received enough attention yet.  It appears
to work, but it doesn't yet support writes (transactions) and it is
difficult to use.  I hope to improve it as it becomes clear what
semantics Python applications actually want from an IDL.
2010-08-25 14:55:48 -07:00