internal/poll, runtime: handle netpollopen error in poll_runtime_pollOpen

When netpollopen in poll_runtime_pollOpen returns an error, the work in
runtime_pollUnblock and runtime_pollClose can be avoided since the
underlying system call to set up the poller failed.

E.g. on linux, this avoids calling netpollclose and thus epoll_ctl(fd,
EPOLL_CTL_DEL, ...) in case the file does not support epoll, i.e.
epoll_ctl(fd, EPOLL_CTL_ADD, ...) in netpollopen failed.

Fixes #44552

Change-Id: I564d90340fd1ab3a6490526353616a447ae0cfb8
Trust: Tobias Klauser <>
Run-TryBot: Tobias Klauser <>
TryBot-Result: Go Bot <>
Reviewed-by: Ian Lance Taylor <>
2 files changed
tree: eed2b4258619c50f85431ba5f93a08d31b7346e8
  1. .gitattributes
  2. .github/
  3. .gitignore
  11. api/
  12. codereview.cfg
  13. doc/
  14. favicon.ico
  15. lib/
  16. misc/
  17. robots.txt
  18. src/
  19. test/

The Go Programming Language

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.

Gopher image Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.

Our canonical Git repository is located at There is a mirror of the repository at

Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.

Download and Install

Binary Distributions

Official binary distributions are available at

After downloading a binary release, visit for installation instructions.

Install From Source

If a binary distribution is not available for your combination of operating system and architecture, visit for source installation instructions.


Go is the work of thousands of contributors. We appreciate your help!

To contribute, please read the contribution guidelines at

Note that the Go project uses the issue tracker for bug reports and proposals only. See for a list of places to ask questions about the Go language.