For some reason, the glibc version check does not enable
GRPC_LINUX_EPOLL on manylinux1. This commit:
* Explicitly enables GRPC_LINUX_LEGACY_EPOLL on MANYLINUX1
* Switches the flag to enable epoll1 IO manager to
GRPC_LINUX_LEGACY_EPOLL instead of GRPC_LINUX_EPOLL.
This is to ensure epollex and epollsig that are not yet
compatible with epoll_create (not epoll_create1) do not
get activated unintentionally.
The Python packages built for Linux and uploaded to PyPI are required to
target a standardized platform specification dubbed `manylinux1`, which
tries to cover a vast array of Linux distributions, thereby emulating a
legacy lowest-common-denominator distribution, with an old `glibc` that
does not support `epoll_create1`, but provides the `epoll_create`
interface. While there are race condition risks associated with
utilizing the latter interface and setting the `O_CLOEXEC` flag
immediately on the file descriptor returned by `epoll_create`, the
payoff is well worth the risks for our Python users, who currently end
up falling back on `poll` polling engine when downloading our Linux
binary packages.
grpc.ServicerContext.abort is documented to always raise an exception
to terminate the RPC. The code argument "must not be StatusCode.OK."
However, if you do pass StatusCode.OK, the RPC terminates successfully
on the client side, but returns None.
_server.py: If the user accidentally passes StatusCode.OK, treat it as
StatusCode.UNKNOWN. This is what happens if the user accidentally
passes something that is not a StatusCode instance. Additionally
set details to ''.
_metadata_code_details_test.py: update test to verify the behavior of
abort with invalid codes.