summaryrefslogtreecommitdiff
path: root/range.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-20 01:43:10 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-20 01:43:10 +0000
commit332b302f92b67cb509ad30d9c930825c5c0c3270 (patch)
tree835bfaae4e7575a281c9eda427879f3a1a28f0b5 /range.c
parent25d274b35a5d466eba25732f3d47834b073c8201 (diff)
spec/ruby/core/io/select_spec.rb: workaround stuck IO.select
Under pipe page memory pressure on Linux, a pipe may only be created with a single buffer[1]. And as of Linux v4.18, the fs/pipe.c::pipe_poll callback does not account for merging done in fs/pipe::pipe_write; only the number of usable buffers in the pipe. Thus it is possible for a pipe to be writable (if only by a small amount) despite IO.select saying it is not. With the default 16384 /proc/sys/fs/pipe-user-pages-soft value and the pipe having 16 pages of buffers, this issue is trivially reproducible by creating 1024 pipes in a background process before running the spec: $ ulimit -n 2053 # or something higher $ ./miniruby -e '1024.times.map { IO.pipe }; sleep' & $ make test-spec MSPECOPT=spec/ruby/core/io/select_spec.rb So, we create a new pipe we never write to for testing writability of IO.select. This may cause the test to fail with ENFILE on an overloaded system, but at least that's an obvious failure (unlike having a test get stuck). This should reduce failures on our overloaded CI machines: http://ci.rvm.jp/results/trunk-nopara@silicon-docker/1239426 [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/pipe.c?h=v4.18#n642 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'range.c')
0 files changed, 0 insertions, 0 deletions