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):
now the stop() method does:
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:
Possible fix: while(not this.stopped)
this bug makes my jenkins instance use 50% cpu after 1 deploy, 100% after 2