Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8169089

Javax websocket 100% CPU utilization on nio thread

XMLWordPrintable

    • x86_64
    • linux

      FULL PRODUCT VERSION :
      jdk_1.8.102

      ADDITIONAL OS VERSION INFORMATION :
      Redhat Linux 7.0

      A DESCRIPTION OF THE PROBLEM :
      When a websocket server has a socket connection that is hung causing a timeout error back to client, closing that connection on the client results in a 100% cpu usage spike on the nio thread reading from the socket. It appears to take a minute before it gives up trying to close the connection and drops back down.

      The issue is there is no sleep logic at all when this read occurs which is what results in the 100% cpu usage. We have retry logic on a hung connection that connects ever 10 seconds which results in an average of 5 of our cores sitting at 100% usage.

      A simple sleep (or a configuration to allow for a sleep) would keep our system from having crippling performance hits when this situation is encountered.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Closing attempts to last same duration, but not have infinite read loop causing 100% CPU usage.

      REPRODUCIBILITY :
      This bug can be reproduced always.

            psonal Pallavi Sonal (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: