From e0c6c0aceb675b60ceb1cad468220b9c31b5cf66 Mon Sep 17 00:00:00 2001 From: Konrad Marszalek Date: Wed, 19 Feb 2020 14:44:44 +0100 Subject: [PATCH 1/2] JPERF-188: Improve stopJira to wait for Jira process to shutdown instead of all Java processes on the node --- CHANGELOG.md | 1 + .../tools/awsinfrastructure/api/CustomDatasetSource.kt | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 200b41cc..c437005d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ Dropping a requirement of a major version of a dependency is a new contract. - Dial down the provisioning logging amount. - Enrich the provisioning logging messages. - Fix `UriJiraFormula` failing to download results due to zero nodes and zero threads. +- Improve `stopJira` to wait only for Jira process shutdown instead of all Java processes [JPERF-595]: https://ecosystem.atlassian.net/browse/JPERF-595 diff --git a/src/main/kotlin/com/atlassian/performance/tools/awsinfrastructure/api/CustomDatasetSource.kt b/src/main/kotlin/com/atlassian/performance/tools/awsinfrastructure/api/CustomDatasetSource.kt index 8956fabd..62b8f30a 100644 --- a/src/main/kotlin/com/atlassian/performance/tools/awsinfrastructure/api/CustomDatasetSource.kt +++ b/src/main/kotlin/com/atlassian/performance/tools/awsinfrastructure/api/CustomDatasetSource.kt @@ -88,8 +88,10 @@ class CustomDatasetSource( private fun stopJira(host: SshHost) { val shutdownTomcat = "echo SHUTDOWN | nc localhost 8005" - val waitForNoJavaProcess = "while ps -C java -o pid=; do sleep 5; done" - Ssh(host, connectivityPatience = 4).newConnection().use { it.safeExecute("$shutdownTomcat && $waitForNoJavaProcess", Duration.ofMinutes(3)) } + val waitForNoJiraProcess = "while pgrep -f jira; do sleep 5; done" + Ssh(host, connectivityPatience = 4).newConnection().use { + it.safeExecute("$shutdownTomcat && $waitForNoJiraProcess", Duration.ofMinutes(3)) + } } private fun stopDockerContainers(host: SshHost) { From e696a723599b14c1a3b7b974be053a5b065ad4e2 Mon Sep 17 00:00:00 2001 From: Konrad Marszalek Date: Tue, 25 Feb 2020 15:43:34 +0100 Subject: [PATCH 2/2] JPERF-188: Use ps command which displays more informantion in case of timeout. Narrow stopJira condition further --- .../tools/awsinfrastructure/api/CustomDatasetSource.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/com/atlassian/performance/tools/awsinfrastructure/api/CustomDatasetSource.kt b/src/main/kotlin/com/atlassian/performance/tools/awsinfrastructure/api/CustomDatasetSource.kt index 62b8f30a..de5563fe 100644 --- a/src/main/kotlin/com/atlassian/performance/tools/awsinfrastructure/api/CustomDatasetSource.kt +++ b/src/main/kotlin/com/atlassian/performance/tools/awsinfrastructure/api/CustomDatasetSource.kt @@ -88,7 +88,7 @@ class CustomDatasetSource( private fun stopJira(host: SshHost) { val shutdownTomcat = "echo SHUTDOWN | nc localhost 8005" - val waitForNoJiraProcess = "while pgrep -f jira; do sleep 5; done" + val waitForNoJiraProcess = "while ps aux | egrep \"[org].apache.catalina.startup.Bootstrap start\"; do sleep 5; done" Ssh(host, connectivityPatience = 4).newConnection().use { it.safeExecute("$shutdownTomcat && $waitForNoJiraProcess", Duration.ofMinutes(3)) }