[threadpool-io] Throw if backend won't be able to register a FD (#16396)
commit78edafd6e2d5ce886e2fd2ddc3cf8bbbffeeb860
authorAleksey Kliger (λgeek) <alklig@microsoft.com>
Mon, 26 Aug 2019 21:13:45 +0000 (26 17:13 -0400)
committerGitHub <noreply@github.com>
Mon, 26 Aug 2019 21:13:45 +0000 (26 17:13 -0400)
tree9d16fd5699c3f39743158afb44055c15aa6e7e92
parent85265d884cf31f8779daba2d639eb795fbc9bd5e
[threadpool-io] Throw if backend won't be able to register a FD (#16396)

The poll+select i/o selector backend can't handle file descriptor ids greater
than FD_SETSIZE.  This can happen if too many files are open and we want to
wait on it.

Previously, mono would fail in the i/o selector thread by which point it was
too late to do anything.

With this change we will fail eagerly on the thread that calls IOSelector.Add
by throwing a NotSupportedException.

Addresses https://github.com/mono/mono/issues/15931
mono/metadata/threadpool-io-epoll.c
mono/metadata/threadpool-io-kqueue.c
mono/metadata/threadpool-io-poll.c
mono/metadata/threadpool-io.c
mono/utils/mono-poll.c
mono/utils/mono-poll.h