xebialabs/overthere

Thread processInputReaderThead created by CifsWinRmConnection never died

zerikv opened this issue · 3 comments

Hello,

After executing commands with a WinRM connection, I can see in Visual VM many living Threads "Input reader for ..." (with OverThere 2.2.2).

These threads are created by CifsWinRmConnection#startProcess and stuck in PipedInputStream#read.

I can fix this issue by adding the following line:

processInputReaderThead.interrupt();

in the finally block of the method waitFor() of the OverthereProcess returned.

Do you see a better way to solve it?

Thanks,

Eric.

Yes, I am facing the same issue.

Same issue here, any suggestion? Thanks

I have found something. The problem here is that when we are creating the process, we are not using the pipedinputstream, so it remains there to listen for an input forever.
In the finally part of the execute method, you can say something like this:
process.getStdin().close;

this will send an EOF to the stream itself, terminating the thread that is trying to read it.