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 — ConcurrentModificationException in NioEventLoop · Issue #654 · netty/netty

ConcurrentModificationException in NioEventLoop #654

New issue
Copy link
New issue
Copy link
Closed
Closed
ConcurrentModificationException in NioEventLoop#654
Copy link
Assignees
normanmaurer
Labels
defect
Milestone
4.0.0.Alpha8

Description

@fbettag
fbettag
opened on Oct 15, 2012
Issue body actions

Under heavy load, i often get this exception:

Oct 15, 2012 7:32:38 PM io.netty.channel.socket.nio.NioEventLoop
WARNING: Unexpected exception in the selector loop.
java.util.ConcurrentModificationException
        at java.util.HashMap$HashIterator.nextEntry(Unknown Source)
        at java.util.HashMap$KeyIterator.next(Unknown Source)
        at io.netty.channel.socket.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:268)
        at io.netty.channel.socket.nio.NioEventLoop.run(NioEventLoop.java:211)
        at io.netty.channel.SingleThreadEventExecutor$1.run(SingleThreadEventExecutor.java:80)
        at java.lang.Thread.run(Unknown Source)

Reporting the issue as request by norman :)

Activity

  1. normanmaurer commented on Oct 15, 2012

    @normanmaurer
    normanmaurer
    on Oct 15, 2012
    Member
    More actions

    @trustin maybe you could check this out :)

  2. trustin commented on Oct 16, 2012

    @trustin
    trustin
    on Oct 16, 2012
    Member
    More actions

    Thanks for reporting this, @fbettag. Let me take a look. Do you have any additional information (how to reproduce, etc)?

  3. fbettag commented on Oct 16, 2012

    @fbettag
    fbettag
    on Oct 16, 2012
    Author
    More actions

    We have no idea, other than the fact that we penetrated the server with ~3-4k concurrent real connections (in one second after startup) - thats peak because theyre long polling/comet

    Sent from my iPhone

    On 16.10.2012, at 19:31, Trustin Lee [email protected] wrote:

    Thanks for reporting this, @fbettag. Let me take a look. Do you have any additional information (how to reproduce, etc)?

    —
    Reply to this email directly or view it on GitHub.

  4. trustin commented on Oct 16, 2012

    @trustin
    trustin
    on Oct 16, 2012
    Member
    More actions

    I tried to reproduce the problem by making a bunch of HTTP connections to the HTTP snoop example, but couldn't. Would you mind if you could modify the HTTP snoop example a little bit to reproduce the problem? I'm using httperf to drive it.

  5. fbettag commented on Oct 16, 2012

    @fbettag
    fbettag
    on Oct 16, 2012
    Author
    More actions

    Hm i will try this tonight.

  6. trustin commented on Oct 16, 2012

    @trustin
    trustin
    on Oct 16, 2012
    Member
    More actions

    Thanks in advance!

  7. fbettag commented on Oct 16, 2012

    @fbettag
    fbettag
    on Oct 16, 2012
    Author
    More actions

    we're basically just holding 2k longpolling connects (comet/websockets), the snoop example simply answers them, but does not hold them. maybe that's the key difference?

  8. kelaneren commented on Nov 7, 2012

    @kelaneren
    kelaneren
    on Nov 7, 2012
    More actions

    I got the same exception with my loadtest when there are more than 2k socket connections. I am using netty with long open raw socket.

  9. normanmaurer commented on Nov 7, 2012

    @normanmaurer
    normanmaurer
    on Nov 7, 2012
    Member
    More actions

    @kelaneren would be possible to weite some testcase ?

  10. ghost assigned
    normanmaurer
    on Nov 7, 2012
  11. normanmaurer commented on Nov 7, 2012

    @normanmaurer
    normanmaurer
    on Nov 7, 2012
    Member
    More actions

    @kelaneren @fbettag I think I fixed it... Could you please retest with latest master ?

  12. fbettag commented on Nov 7, 2012

    @fbettag
    fbettag
    on Nov 7, 2012
    Author
    More actions

    Yup in a second

  13. fbettag commented on Nov 8, 2012

    @fbettag
    fbettag
    on Nov 8, 2012
    Author
    More actions

    We don't see the exception anymore! Not sure if the problem is gone tho. @kelaneren anything?

  14. normanmaurer commented on Nov 8, 2012

    @normanmaurer
    normanmaurer
    on Nov 8, 2012
    Member
    More actions

    w00t :) I will close it as I'm sure it's fixed... Anyway would be nice if @kelaneren could also test it out ...

  15. normanmaurer
    closed this as completedon Nov 8, 2012
  16. kelaneren commented on Nov 8, 2012

    @kelaneren
    kelaneren
    on Nov 8, 2012
    More actions

    I upgraded netty in my project from 4.0.0.alpha1 to 4.0.0.alpha8 with this fix and got 100% cpu usage when I ran the same loadtest with 2000 connections. I am going to dig more

  17. normanmaurer commented on Nov 8, 2012

    @normanmaurer
    normanmaurer
    on Nov 8, 2012
    Member
    More actions

    Would it be possible to share your "loadtest" ?

    Norman Maurer
    [email protected]

    Am 08.11.2012 um 13:11 schrieb kelaneren [email protected]:

    I upgraded netty in my project from 4.0.0.alpha1 to 4.0.0.alpha8 with this fix and got 100% cpu usage when I ran the same loadtest with 2000 connections. I am going to dig more

    —
    Reply to this email directly or view it on GitHub.

  18. kelaneren commented on Nov 8, 2012

    @kelaneren
    kelaneren
    on Nov 8, 2012
    More actions

    Sorry, it's specific to our project. During netty upgrading, I changed

    b = new ServerBootstrap()

    from b.eventLoop(new NioEventLoop(), new NioEventLoop())
    to b.group(new NioEventLoopGroup(), new NioEventLoopGroup())

    And the buff used in channel.write(buff) is changed from

    var buff = new DynamicByteBuf(size);

    to

    var buff = new DirectByteBuf(size)

    I will do some profiling. probably extract it into a more generic test in future

  19. normanmaurer commented on Nov 8, 2012

    @normanmaurer
    normanmaurer
    on Nov 8, 2012
    Member
    More actions

    Two things..

    1. Do you create many ServerBootstrap instances ? In this case you should share your NioEventLoopGroup instances
    2. Replace DirectByteBuf(size) with Unpooled.buffer(size);
  20. kelaneren commented on Nov 8, 2012

    @kelaneren
    kelaneren
    on Nov 8, 2012
    More actions

    Thanks Norman. It was our own issue caused by config change. I confirmed this ConcurrentModificationException is fixed. Cheers

  21. fbettag commented on Nov 8, 2012

    @fbettag
    fbettag
    on Nov 8, 2012
    Author
    More actions

    @kelaneren could you elaborate on that 100% cpu issue? we're having the same thing over here and no idea what's causing it.

  22. normanmaurer commented on Nov 8, 2012

    @normanmaurer
    normanmaurer
    on Nov 8, 2012
    Member
    More actions

    Could get some thread dumps and identify the stack of it ..

    http://www.semicomplete.com/blog/geekery/debugging-java-performance.html

    Am 08.11.2012 um 19:21 schrieb Franz Bettag [email protected]:

    @kelaneren could you elaborate on that 100% cpu issue? we're having the same thing over here and no idea what's causing it.

    —
    Reply to this email directly or view it on GitHub.

  23. fbettag commented on Nov 8, 2012

    @fbettag
    fbettag
    on Nov 8, 2012
    Author
    More actions

    io ~ # jps

    • jps is not available for oracle-jre-bin-1.7 on x86_64
    • IMPORTANT: some Java tools are not available on some VMs on some architectures
      io ~ # jstack
    • jstack is not available for oracle-jre-bin-1.7 on x86_64
    • IMPORTANT: some Java tools are not available on some VMs on some architectures

    :(

  24. fbettag commented on Nov 8, 2012

    @fbettag
    fbettag
    on Nov 8, 2012
    Author
    More actions

    we'll try it with icedtea now!

  25. normanmaurer commented on Nov 8, 2012

    @normanmaurer
    normanmaurer
    on Nov 8, 2012
    Member
    More actions

    You need to install the jdk...

    Also you can use kill -3 as replacement for jstack

    Sent from my iPhone. Excuse any typos....

    Am 08.11.2012 um 19:55 schrieb Franz Bettag [email protected]:

    io ~ # jps

    jps is not available for oracle-jre-bin-1.7 on x86_64
    IMPORTANT: some Java tools are not available on some VMs on some architectures io ~ # jstack
    jstack is not available for oracle-jre-bin-1.7 on x86_64
    IMPORTANT: some Java tools are not available on some VMs on some architectures
    :(

    —
    Reply to this email directly or view it on GitHub.

  26. kelaneren commented on Nov 9, 2012

    @kelaneren
    kelaneren
    on Nov 9, 2012
    More actions

    I got 100% cpu usage again after increase numbers of connections and cpu usage didn't drop after all clients are closed. I did the same test with netty 3.5.9.final. CPU usage is normal. However, I can't increase number of long open connections. After the number is increased to 4k, I got

    2012-11-09 11:18:30,810-[New I/O worker #1] ERROR c.s.b.net.FramedSocketServerHandler Unexpected exception from downstream.
    java.nio.channels.ClosedChannelException: null
    at org.jboss.netty.channel.socket.nio.AbstractNioWorker.cleanUpWriteBuffer(AbstractNioWorker.java:785) ~[game-service.jar:na]
    at org.jboss.netty.channel.socket.nio.AbstractNioWorker.close(AbstractNioWorker.java:729) ~[game-service.jar:na]
    at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:89) ~[game-service.jar:na]
    at org.jboss.netty.channel.socket.nio.AbstractNioWorker.processSelectedKeys(AbstractNioWorker.java:472) ~[game-service.jar:na]
    at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:333) ~[game-service.jar:na]
    at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:35) ~[game-service.jar:na]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [na:1.7.0_07]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [na:1.7.0_07]
    at java.lang.Thread.run(Thread.java:722) [na:1.7.0_07]

    not sure these are related to this ticket or not. will dig more

  27. fbettag commented on Nov 9, 2012

    @fbettag
    fbettag
    on Nov 9, 2012
    Author
    More actions

    i can confirm this issue

  28. normanmaurer commented on Nov 9, 2012

    @normanmaurer
    normanmaurer
    on Nov 9, 2012
    Member
    More actions

    @fbettag what you can confirm ?
    @kelaneren please open another issue with as much infos as possible

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

Metadata

Metadata

Assignees

  • @normanmaurer
    normanmaurer

Labels

defect

Type

No type

Projects

No projects

    Milestone

    • 4.0.0.Alpha8

    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.