Skip to content

Commit 1bbd58e

Browse files
authored
Fix 'Aborted!' message on successful local lambda debug (#2422)
1 parent 4396078 commit 1bbd58e

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "bugfix",
3+
"description" : "Fix transient 'Aborted!' message on successful SAM CLI local Lambda execution"
4+
}

buildspec/linuxIntegrationTests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ phases:
4848
- $SAM_CLI_EXEC --version
4949
- chmod +x gradlew
5050
- env AWS_ACCESS_KEY_ID=$KEY_ID AWS_SECRET_ACCESS_KEY=$SECRET AWS_SESSION_TOKEN=$TOKEN ./gradlew integrationTest coverageReport --info --full-stacktrace --console plain
51+
- if [ $(docker ps -q | wc -l) -gt 0 ]; then echo 'Docker containers were not completely cleaned up!'; docker ps; exit 1; fi
5152
- VCS_COMMIT_ID="${CODEBUILD_RESOLVED_SOURCE_VERSION}"
5253
- CI_BUILD_URL=$(echo $CODEBUILD_BUILD_URL | sed 's/#/%23/g') # Encode `#` in the URL because otherwise the url is clipped in the Codecov.io site
5354
- CI_BUILD_ID="${CODEBUILD_BUILD_ID}"

jetbrains-core/src/software/aws/toolkits/jetbrains/services/lambda/execution/sam/SamRunningState.kt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,16 @@ class SamRunningState(
7878

7979
// Unix: Sends SIGINT on destroy so Docker container is shut down
8080
// Windows: Run with mediator to allow for Cntrl+C to be used
81-
return KillableColoredProcessHandler(commandLine, true)
81+
return object : KillableColoredProcessHandler(commandLine, true) {
82+
override fun doDestroyProcess() {
83+
// send signal only if user explicitly requests termination
84+
if (this.getUserData(ProcessHandler.TERMINATION_REQUESTED) == true) {
85+
super.doDestroyProcess()
86+
} else {
87+
detachProcess()
88+
}
89+
}
90+
}
8291
}
8392

8493
private fun createEventFile(): String {

0 commit comments

Comments
 (0)