This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients pitrou, vstinner, yselivanov
Date 2018-06-01.13:18:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1527859099.35.0.682650639539.issue33733@psf.upfronthosting.co.za>
In-reply-to
Content
Many Python unit tests require a blocking send into a pipe or a socket.

support.PIPE_MAX_SIZE (4 MiB +1 B) has been added for pipes in bpo-17835: sending PIPE_MAX_SIZE into a pipe must block.

On Linux, the maximum size of a pipe is /proc/sys/fs/pipe-max-size. Since Linux 2.6.35, it's now possible to get and set the size of a pipe using fcntl with F_GETPIPE_SZ and F_SETPIPE_SZ commands.

For sockets, support.SOCK_MAX_SIZE (16 MiB) has been added in bpo-18643. It's possible to get/set the size of receive and send socket buffers using getsockopt() and setsockopt() with SO_RCVBUF and SO_SNDBUF commands.

For pipes, I'm not sure that it's possible to get the size of a pipe buffer in a portable way. For example, F_GETPIPE_SZ was only introduced in Linux 2.6.35.

Since the first user of these features are tests, maybe we can start with best-effort functions in test.support.

Recently, I got issues with buffer sizes in test_multiprocessing_forkserver.test_ignore() (bpo-33532) and sendfile tests of test_asyncio (bpo-33353).
History
Date User Action Args
2018-06-01 13:18:19vstinnersetrecipients: + vstinner, pitrou, yselivanov
2018-06-01 13:18:19vstinnersetmessageid: <1527859099.35.0.682650639539.issue33733@psf.upfronthosting.co.za>
2018-06-01 13:18:19vstinnerlinkissue33733 messages
2018-06-01 13:18:19vstinnercreate