mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 06:15:47 +00:00
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>
This commit is contained in:
@@ -372,6 +372,9 @@ class Session(object):
|
||||
if ovs.stream.PassiveStream.is_valid_name(name):
|
||||
reconnect.set_passive(True, ovs.timeval.msec())
|
||||
|
||||
if ovs.stream.stream_or_pstream_needs_probes(name):
|
||||
reconnect.set_probe_interval(0)
|
||||
|
||||
return Session(reconnect, None)
|
||||
|
||||
@staticmethod
|
||||
|
@@ -24,6 +24,19 @@ import ovs.vlog
|
||||
vlog = ovs.vlog.Vlog("stream")
|
||||
|
||||
|
||||
def stream_or_pstream_needs_probes(name):
|
||||
""" 1 if the stream or pstream specified by 'name' needs periodic probes to
|
||||
verify connectivty. For [p]streams which need probes, it can take a long
|
||||
time to notice the connection was dropped. Returns 0 if probes aren't
|
||||
needed, and -1 if 'name' is invalid"""
|
||||
|
||||
if PassiveStream.is_valid_name(name) or Stream.is_valid_name(name):
|
||||
# Only unix and punix are supported currently.
|
||||
return 0
|
||||
else:
|
||||
return -1
|
||||
|
||||
|
||||
class Stream(object):
|
||||
"""Bidirectional byte stream. Currently only Unix domain sockets
|
||||
are implemented."""
|
||||
|
Reference in New Issue
Block a user