Code Monkey home page Code Monkey logo

epollarraywrapper-bug's Introduction

EPollArrayWrapper.epollWait(...) issue

These maven projects demonstrate that sun.nio.ch.EPollArrayWrapper bug where EPollArrayWrapper.epollWait(...) may return events for file descriptors that were previously removed.

The consequences are:

  1. Selector.select() returns immediately with 0 event
  2. Jetty then spins into infinite loops and consumes one CPU core at 100% for nothing.

I have reproduced this issue with many JDK 8, and seems to be fixed on JDK 11.

It is registered in Java bug system at [JDK-8238279] EPollArrayWrapper.epollWait() may return events for removed file descriptors - Java Bug System.

This repository contains 2 projects:

  • demonstrator : reproduces the bug
  • jre-patch : this is a java agent that patches the EPollArrayWrapper JDK class to fix the issue

How to execute the demonstator

  1. Clone or download the repository
  2. Go to the demonstrator directory
  3. Execute maven package
  4. Execute java -jar './target/org.modelio.jre.epollarray.test-0.0.1-jar-with-dependencies.jar

How to test the patch

Warn: This patch has only been quickly tested, I make absolutly no guaranty !

Under no circumstances will myself nor Modeliosoft be held liable for any damage whatsoever resulting from the use or performance of this software.

It also dumps some debug logs directly to System.out.

  1. Clone or download the repository
  2. Go to the demonstrator directory
  3. Execute maven package
  4. Add the following parameter to you JVM command line: -javaagent:.....demonstrator/target/org.modelio.jre.epollarray.patch-0.0.1.jar

Possibly related issues

This issue may be the cause of the following ones:

Possible cause

This web page explains a possible cause the JDK issue: https://idea.popcount.org/2017-03-20-epoll-is-fundamentally-broken-22/

epollarraywrapper-bug's People

Contributors

cedric780 avatar

Stargazers

Benjamin Wang avatar  avatar

Watchers

Kenny Bastani avatar  avatar

epollarraywrapper-bug's Issues

Support for Patch

Hi Cedric!

This is a surprisingly simple fix compared to what Netty did.

May we request your help in patching our socket channel reader for Linux? We can pay a stipend for a solution that works across various Linux editions. So far we know we have problems on Heroku Ubuntu and CentOS, and it may also be a problem on AWS CentOS (only partially confirmed).

vlingo/xoom-wire#28

Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.