Changing default Epoll mode in Go runtime

Hi there,

For my research project, I’m trying to change the Go runtime to use “Epolloneshot” instead of the default “Edge-Triggered” mode. Based on what I’ve gathered from the code, I’ve made changes to two functions in src/runtime/netpoll_epoll.go.

First, I updated the netpollopen function to use the Epolloneshot flag instead of the Epollet flag. Second, I modified the netpollarm function, which isn’t used in Linux, to rearm notifications for Epolloneshot. I also tweaked poll_runtime_pollWait() in src/runtime/netpoll.go to call netpollarm for Linux.

Now, I’m running into an issue where HTTP tests for compiling Go are failing. Here’s the error I’m seeing:
“httptest.Server blocked in Close after 5 seconds, waiting for connections:
*net.TCPConn 0xc000221520 in state active
panic: test timed out after 9m0s”

I suspect that the rearming might be incorrect, causing the server to stall indefinitely.

For reference, I’m using Ubuntu 22.04 and Go 1.18.10.