Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2026-10-28
11:10 • Ticket [59e7e7fdfb] socket -async throws when the connect fails at once (illumos... artifact: d8c0815433 user: serhiy.storchaka
11:09
Fix [59e7e7fdfb]: do not throw from [socket -async] when the connect fails at once, as illumos does ... check-in: f53502fa2a user: serhiy.storchaka tags: core-8-6-branch
2026-10-18
20:26 • Closed ticket [59e7e7fdfb]: socket -async throws when the connect fails at once ... artifact: d8fe43ba8a user: jan.nijtmans
20:23
Fix [e99187025f], [dbf9884c56] and [59e7e7fdfb]: socket-related test portability improvements check-in: aba76913eb user: jan.nijtmans tags: core-9-0-branch
20:23
Fix [e99187025f], [dbf9884c56] and [59e7e7fdfb]: socket-related test portability improvements check-in: 03198ed31c user: jan.nijtmans tags: trunk, main
2026-10-12
08:10 • New ticket [59e7e7fdfb] socket -async throws when the connect fails at once (ill... artifact: c364ffe32a user: serhiy.storchaka
08:06
Fix [59e7e7fdfb]: do not throw from [socket -async] when the connect fails at once, as illumos does ... closed check-in: bb3b66fd5b user: serhiy.storchaka tags: unix-async-connect-immediate-failure

socket -async throws when the connect fails at once (illumos)

Closed / Fixed59e7e7fdfbcd8ee34a5a51a9a83990c7115ecc03Created 52 days agoUpdated 35 days ago
Descriptionwiki2026-10-12 08:10:00
On illumos (OpenIndiana), a non-blocking connect() to a local port without a listener fails at once with ECONNREFUSED instead of EINPROGRESS. Then socket -async throws couldn't open socket: connection refused instead of returning a channel which reports the failure with fconfigure -error and the writable event, as socket(n) describes. This fails socket-14.2, 14.7.2, 14.8.2, 14.11.0, 14.12, 14.14-14.18 and http-4.14.

This was seen on Solaris before ([3428754]: test socket-14.2 was made to accept the error), but since the 2014 rework the tests expect the error to be reported only by fconfigure -error ([42d50ebd0c]).

Proposed fix in branch unix-async-connect-immediate-failure: an async connect which fails at once is reported like a failure in the background. socket-14.11.1, 14.16 and 14.17, which need the connect to be still in progress, get a new constraint asyncConnectPending.

Referenced by4
  • f53502fa2aFix [59e7e7fdfb]: do not throw from [socket -async] when the connect fails at once, as illumos does for a local port without a listener: report the error with [fconfigure -error] and the writable event, as for a failure in the background. New test constraint asyncConnectPending for socket-14.16 and 14.17. check-in2026-10-28 11:09:51
  • aba76913ebFix [e99187025f], [dbf9884c56] and [59e7e7fdfb]: socket-related test portability improvements check-in2026-10-18 20:23:46
  • 03198ed31cFix [e99187025f], [dbf9884c56] and [59e7e7fdfb]: socket-related test portability improvements check-in2026-10-18 20:23:23
  • bb3b66fd5bFix [59e7e7fdfb]: do not throw from [socket -async] when the connect fails at once, as illumos does for a local port without a listener: report the error with [fconfigure -error] and the writable event, as for a failure in the background. New test constraint asyncConnectPending for tests which need the connect to be still in progress (socket-14.11.1, 14.16, 14.17). check-in2026-10-12 08:06:54
jan.nijtmanswiki2026-10-18 20:26:48

Fixed in [trunk], backported to core-9-0-branch

Many thanks!

serhiy.storchakawiki2026-10-28 11:10:23

Backported to 8.6: [f53502fa2a].

Log in (anonymous is fine) to add a comment.