GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Epoll channel register creates a busy-loop with high CPU usage · Issue #16240 · netty/netty

Epoll channel register creates a busy-loop with high CPU usage #16240

New issue
Copy link
New issue
Copy link
Closed
#16250
Closed
Epoll channel register creates a busy-loop with high CPU usage#16240
#16250
Copy link
Milestone
4.2.11.Final

Description

@isaacrivriv
isaacrivriv
opened on Feb 8, 2026
Issue body actions

Following the discussion #16236, I'm opening this issue to discuss a solution. When using the native Epoll implementation, I'm seeing a high CPU usage when a server channel is registered to the EventLoop but not yet bound to a port. After some investigation, I'm seeing the issue seems to lie in the epollWait method not waiting but returning every time with an EPOLLHUP event. I don't know a lot about the native Epoll side, but I'm assuming this is normal because the channel hasn't been bound to a port yet and so epoll generating the event makes sense to me based off what I have read.

This behavior however, causes the eventloop thread to be constantly spinning with no work happening and from testing, this will always happen until the channel is bound to a port and will consume a lot of CPU. Does it make sense to treat is as an issue or is this working as designed? I have an alternative in mind to wait on registering inactive channels until they are active but I wanted to bring this up before I work on a PR.

Activity

  1. normanmaurer commented on Feb 8, 2026

    @normanmaurer
    normanmaurer
    on Feb 8, 2026
    Member
    More actions

    This is definitely an issue ... let me check in detail

  2. franz1981 commented on Feb 8, 2026

    @franz1981
    franz1981
    on Feb 8, 2026
    Contributor
    More actions

    In the event processing loop we could check if the channel is active before processing EPOLLHUP events. If inactive, simply ignore the event 🤔

  3. normanmaurer commented on Feb 8, 2026

    @normanmaurer
    normanmaurer
    on Feb 8, 2026
    Member
    More actions

    In the event processing loop we could check if the channel is active before processing EPOLLHUP events. If inactive, simply ignore the event 🤔

    I will provide a better fix tomorrow

    Reacted by Isaac A. Rivera Rivas
    Reacted by Francesco Nigro
  4. isaacrivriv commented on Feb 8, 2026

    @isaacrivriv
    isaacrivriv
    on Feb 8, 2026
    ContributorAuthor
    More actions

    Thanks for taking a look!!

    In the event processing loop we could check if the channel is active before processing EPOLLHUP events. If inactive, simply ignore the event 🤔

    I did try this Francesco but unfortunately because the channel is still registered in epoll, whenever the next epollWait is called it will still return immediately continuing the busy loop... A solution I found that would work was to wait on calling epollCtlAdd until the channel is active, by then the EPOLLHUP events would no longer continue occurring and the implementation would work as expected.

    I'll leave it to @normanmaurer for a proper solution and continue monitoring. Thanks again!

  5. normanmaurer commented on Feb 9, 2026

    @normanmaurer
    normanmaurer
    on Feb 9, 2026
    Member
    More actions

    This is a bit more complicated as it also needs some other fixes. Working on it.

    Reacted by Isaac A. Rivera Rivas
  6. normanmaurer
    added this to the 4.2.11.Final milestone on Feb 10, 2026
  7. normanmaurer
    added a commit that references this issue on Feb 10, 2026

    Epoll: Fix excessive CPU usage when Channel is only registered but no…

    168eb58
  8. normanmaurer commented on Feb 10, 2026

    @normanmaurer
    normanmaurer
    on Feb 10, 2026
    Member
    More actions

    @isaacrivriv PTAL #16250

  9. normanmaurer
    added a commit that references this issue on Feb 12, 2026

    Epoll: Fix excessive CPU usage when Channel is only registered but no… (

    60bd05f
  10. normanmaurer
    closed this as completedin #16250on Feb 12, 2026
  11. normanmaurer
    added a commit that references this issue on Feb 12, 2026

    Epoll: Fix excessive CPU usage when Channel is only registered but no… (

    fce9414
  12. normanmaurer commented on Feb 12, 2026

    @normanmaurer
    normanmaurer
    on Feb 12, 2026
    Member
    More actions

    Ok verified... this problem only affects 4.2 and 5.0

  13. normanmaurer
    added a commit that references this issue on Feb 12, 2026

    Epoll: Fix excessive CPU usage when Channel is only registered but no… (

    46bbed1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      • 4.2.11.Final

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.