Uploaded image for project: 'Codehaus Cargo'
  1. CARGO-966

JBoss4Deployer triggers inifinite loop in SimpleHttpServer, consumes 100%CPU

    Details

    • Type: Bug
    • Status: Closed (View workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects versions: 1.0.6
    • Fix versions: 1.1.0
    • Components: JBoss
    • Labels:
      None
    • Environment:

      windows, jre6, hudson, jboss

      Description

      The invoke remotely method starts the fileserver then does its thing and finaly calls stop on the fileserver.

      the fileserver start method creates a new thread with self and starts the thread. the thread invokes run, which invokes runAndThrow.
      runAndThrow reads (pseudo code):

      while(true){
      try{
      socket.accept()
      }catch{SocketException){
      // doNothing
      }finally{
      close socket if not null
      }
      }//endwhile
      

      now the stop() method does:

      stopped=true;
      socket.close()
      

      after a socket is closed, it will throw a SocketException for threads blocked in accept() (including a thread which reenters accept()),so the file server goes like this:

      while(true){
      try{
      throw new SocketException();
      }catch(SocketException s){
      //donothing
      }finally{
      close socket
      }
      }//endwhile
      

      Possible fix: while(not this.stopped)

      this bug makes my jenkins instance use 50% cpu after 1 deploy, 100% after 2

        Attachments

          Activity

            People

            • Assignee:
              savasalitokmen Savas Ali Tokmen (Inactive)
              Reporter:
              jeanhelou Jean Helou (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: