DESCRIPTION

Systemtap: terminate parser processes on stop.

When a Parser job is cancelled, terminate the underlying stap process
whether it is a local or remote process. Consequently, cause any
process run remotely by means of execRemote to be terminated when its
Jsch session is closed.

Change-Id: Ibd4d3a04069cf30086a78985f02dad72e8782c60
Signed-off-by: Landon Wilkins xxx@xxx.xxx


COMMENTS

author: Landon Wilkins
date: 2015-04-30 21:48:37.000000000

Uploaded patch set 1.

-------------------------------------
author: Brenden Conley
date: 2015-04-30 21:48:44.000000000

Patch Set 1:

Build Started https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/9490/

-------------------------------------
author: Landon Wilkins
date: 2015-04-30 22:00:24.000000000

Patch Set 1:

Without this patch, if a Parser job is canceled, the underlying stap process continues to run. This is especially a problem for the Probe Parser, whose underlying stap command takes a long time to run & consumes plenty of CPU.

The part of this patch that fixes the problem is the change to execRemote, where the remote channel is told to use a pseudoterminal. This causes the process that is run through the channel to be terminated when the channel's session is closed.

LinuxtoolsProcessFactory.terminateProcess was added as a way to terminate a remote process without having to close the session. It isn't ever used by this patch, so if we don't want to have to update the bundle version just for having added that method, we can take it out.

-------------------------------------
author: Brenden Conley
date: 2015-04-30 22:09:45.000000000

Patch Set 1: Verified+1

Build Successful 

https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/9490/ : SUCCESS

-------------------------------------
author: Erick Ross
date: 2015-05-01 11:19:58.000000000

Patch Set 1:

Any chance for this change being accompanied by some test case?

-------------------------------------
author: Landon Wilkins
date: 2015-05-01 16:32:36.000000000

Patch Set 1:

> Any chance for this change being accompanied by some test case?

The build would need to be able to run a stap process for me to be able to directly test the Parser fix. Last I remember, the build machines don't/shouldn't need to have stap installed. However, if there is some arbitrary long-running process that the build can run instead of stap, I can to create a test that checks whether the new remote process termination works.

-------------------------------------
author: Landon Wilkins
date: 2015-05-01 21:20:06.000000000

Patch Set 1:

I've taken time to think about how to test this; we need to have the login credentials of one of the build machines in order to test running processes through JSch / execRemote. I discussed this with Roland, and he brought up the possibility of creating a new account on the build system that we could JSch into.

Is this something we should consider? I'm not sure of anything else we could do, other than knowing the credentials of the build machine's "default" account (but Hudson job configurations imply that we're using anonymous builds, so even that might not work).

-------------------------------------
author: Erick Ross
date: 2015-05-04 06:40:46.000000000

Patch Set 1:

No, having special account on test machine is a no-go as it would break tests running for people on their own machines and offline. Such cases should be tested with solutions like easymock/mockito/etc. but if it's gonna take too much time let's move on.

-------------------------------------
author: Erick Ross
date: 2015-05-04 06:41:22.000000000

Patch Set 1: Code-Review+2

-------------------------------------
author: Erick Ross
date: 2015-05-04 06:41:30.000000000

Change has been successfully cherry-picked as 29fbe077e05f4044bdd245f981920920222c4f0f

-------------------------------------
