Details
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 ![]()
Committed revision 2877.
Thank you for the detailed analysis and the patch