Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thread processInputReaderThead created by CifsWinRmConnection never died #87

Closed
zerikv opened this issue Oct 29, 2013 · 3 comments
Closed

Comments

@zerikv
Copy link
Contributor

zerikv commented Oct 29, 2013

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.

@macche80
Copy link

Yes, I am facing the same issue.

@enlinxu
Copy link

enlinxu commented Nov 14, 2013

Same issue here, any suggestion? Thanks

@macche80
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants