diff options
author | Ilya Maximets <i.maximets@samsung.com> | 2019-01-09 20:30:17 +0300 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2019-01-10 15:42:54 -0800 |
commit | 04895042e9f62dd738ef5424e45925a6637d03db (patch) | |
tree | 8ebde7e3691da53bb77f78f335c010e42c4694fd /include/openvswitch | |
parent | 77f42ca53581089a15ede670f0be6b6203360491 (diff) | |
download | openvswitch-04895042e9f62dd738ef5424e45925a6637d03db.tar.gz |
vconn: Allow timeout configuration for blocking connection.
On some systems in case where remote is not responding, socket could
remain in SYN_SENT state for a really long time without errors waiting
for connection. This leads to situations where vconn connection hangs
for a few minutes waiting for connection to the DOWN remote.
For example, this situation emulated by "refuse-connection" vconn
testcase. This leads to test failures because Alarm signal arrives much
faster than ETIMEDOUT from the socket:
./vconn.at:21: ovstest test-vconn refuse-connection tcp
Alarm clock
stderr:
|socket_util|INFO|0:127.0.0.1: listening on port 63812
|poll_loop|DBG|wakeup due to 0-ms timeout
|poll_loop|DBG|wakeup due to 10155-ms timeout
|fatal_signal|WARN|terminating with signal 14 (Alarm clock)
./vconn.at:21: exit code was 142, expected 0
vconn.at:21: 535. tcp vconn - refuse connection (vconn.at:21): FAILED
This patch allowes to specify timeout value for vconn blocking
connections. If the connection takes more time, socket will be closed
with ETIMEDOUT error code. Negative value could be used to wait
infinitely.
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'include/openvswitch')
-rw-r--r-- | include/openvswitch/vconn.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/openvswitch/vconn.h b/include/openvswitch/vconn.h index b30d46af0..dfb7f7522 100644 --- a/include/openvswitch/vconn.h +++ b/include/openvswitch/vconn.h @@ -73,8 +73,8 @@ void vconn_run_wait(struct vconn *); int vconn_get_status(const struct vconn *); int vconn_open_block(const char *name, uint32_t allowed_versions, uint8_t dscp, - struct vconn **); -int vconn_connect_block(struct vconn *); + long long int timeout, struct vconn **); +int vconn_connect_block(struct vconn *, long long int timeout); int vconn_send_block(struct vconn *, struct ofpbuf *); int vconn_recv_block(struct vconn *, struct ofpbuf **); |