[FX-192] Reliable session fails to re-connect on connection errors - Fix8 JIRA

Reliable session fails to re-connect on connection errors

Description

I am trying to run f8test. It fails to re-connect on connection errors, the log:

1 2 3 4 5 6 7 8 9 10 11 12 0000001 A 2014-01-28 16:38:15.899097690 Starting session 0000002 A 2014-01-28 16:38:15.899172933 Trying to connect to: 127.0.0.1:1234 (1) not-secured 0000003 A 2014-01-28 16:38:18.899605357 exception: Timeout: connect timed out: 127.0.0.1:1234 0000004 A 2014-01-28 16:38:21.899708275 Trying to connect to: 127.0.0.1:1234 (2) not-secured 0000005 A 2014-01-28 16:38:21.899753531 exception: I/O error: Operation already in progress 0000006 A 2014-01-28 16:38:24.899861928 Trying to connect to: 127.0.0.1:1234 (3) not-secured 0000007 A 2014-01-28 16:38:24.899912132 exception: I/O error: Operation already in progress 0000008 A 2014-01-28 16:38:27.900015726 Trying to connect to: 127.0.0.1:1234 (4) not-secured 0000009 A 2014-01-28 16:38:27.900065533 exception: I/O error: Operation already in progress 0000010 A 2014-01-28 16:38:30.900157618 Trying to connect to: 127.0.0.1:1234 (5) not-secured 0000011 A 2014-01-28 16:38:30.900194326 exception: I/O error: Operation already in progress 0000012 A 2014-01-28 16:38:33.900277207 Connection failed

It basically says, that after connect() timed out, further connection attempts failed with EINPROGESS, whereas they should fail with the same error.

Looking in the source code ClientConnection::connect() it seems that the socket is not re-created before trying to connect again.

Also, the socket options should be set before connecting, otherwise they may have no effect, see man tcp(7):

On individual connections, the socket buffer size must be set prior to the listen(2) or connect(2) calls in order to have it take effect. See socket(7) for more information.

Environment

Linux 3.12.8-300.fc20.x86_64 #1 SMP Thu Jan 16 01:07:50 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Status

Assignee

David Dight

Reporter

Maxim Yegorushkin

Labels

None

Branch

dev

Products

None

Components

Fix versions

Affects versions

1.0.0

Priority

Major