Page MenuHomeFreeBSD

tests/unix_seqpacket: remove EMSGSIZE tests
ClosedPublic

Authored by glebius on Feb 6 2024, 12:27 AM.
Tags
None
Referenced Files
F84152281: D43756.id.diff
Mon, May 20, 2:08 AM
F84132150: D43756.id133898.diff
Sun, May 19, 7:43 PM
Unknown Object (File)
Fri, May 17, 6:30 PM
Unknown Object (File)
Tue, May 7, 7:35 AM
Unknown Object (File)
Sat, Apr 27, 5:20 PM
Unknown Object (File)
Thu, Apr 25, 7:04 PM
Unknown Object (File)
Wed, Apr 24, 3:15 AM
Unknown Object (File)
Apr 14 2024, 5:37 PM
Subscribers

Details

Summary

These tests were not testing conformance to the specification, rather than
the limitation of our implementation. The specification doesn't say that
a SOCK_SEQPACKET shall ever return EMSGSIZE. It says:

The SOCK_SEQPACKET socket type is similar to the SOCK_STREAM type,
and is also connection-oriented. The only difference between these
types is that record boundaries are maintained using the
SOCK_SEQPACKET type. A record can be sent using one or more output
operations and received using one or more input operations, but a
single operation never transfers parts of more than one record.
Record boundaries are visible to the receiver via the MSG_EOR flag
in the received message flags returned by the recvmsg() function. It
is protocol-specific whether a maximum record size is imposed.

The EMSGSIZE is specified as 'message is too large to be sent all at once,
as the socket requires'. Indeed existing implementation that has
unix/seqpacket marked as PR_ATOMIC has such a limitation. But future
implementation won't have, thus remove the tests.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

So in the future it will be possible to send a single record with multiple send syscalls? In that case we can certainly remove these tests. However, in the future it will be important to ensure that we can send messages larger than the socket buffer size, right? In that case, I think we should leave these tests here for now, and update them atomically when the new behavior is committed. That way we won't forget.

This revision is now accepted and ready to land.Feb 6 2024, 1:23 AM

I will provide tests that you can write a record larger than socket buffer with a blocking write, or with several non-blocking writes. I'm going to commit them together with or after the new implementation.

A preview is here (still very immature code): https://github.com/freebsd/freebsd-src/commit/0ed33339e1a012a4ca8a583193cac8510332dba3

glebius retitled this revision from test/unix_seqpacket: remove EMSGSIZE tests to tests/unix_seqpacket: remove EMSGSIZE tests.Feb 28 2024, 10:20 PM
This revision was automatically updated to reflect the committed changes.