generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
CTRL+C doesn't terminate sessions on Windows. I tested on both Linux and Windows and confirmed only Windows was affected.
Expected Behaviour
CTRL+C to terminate the session on Windows.
Current Behaviour
CTRL+C doesn't terminate session on Windows. I
Reproduction Steps
On windows, with the following template:
specificationVersion: jobtemplate-2023-09
name: Python script
steps:
- name: Run
script:
actions:
onRun:
command: python
args: ['{{Task.File.sleep}}']
embeddedFiles:
- name: sleep
type: TEXT
filename: sleep.py
data: |
import time
for i in range(10):
print(f"Waiting {i}", flush=True)
time.sleep(1)
print("Exiting script.")
Run
openjd run template.yaml --step Run and then send CTRL+C.
The program will fail to exit and only once the session is over you will see that it did attempt to cancel the session. Here are some logs:
(venvtemp) C:\tmp\venvtemp>openjd run template.yaml --step Run
Wed Sep 11 15:39:15 2024
Wed Sep 11 15:39:15 2024 ==============================================
Wed Sep 11 15:39:15 2024 --------- Running Task
Wed Sep 11 15:39:15 2024 ==============================================
Wed Sep 11 15:39:15 2024 ----------------------------------------------
Wed Sep 11 15:39:15 2024 Phase: Setup
Wed Sep 11 15:39:15 2024 ----------------------------------------------
Wed Sep 11 15:39:15 2024 Writing embedded files for Task to disk.
Wed Sep 11 15:39:15 2024 Mapping: Task.File.sleep -> C:\ProgramData\Amazon\OpenJD\sample_session4n3p_urq\embedded_files2uo2tdd_\sleep.py
Wed Sep 11 15:39:15 2024 Wrote: sleep -> C:\ProgramData\Amazon\OpenJD\sample_session4n3p_urq\embedded_files2uo2tdd_\sleep.py
Wed Sep 11 15:39:15 2024 ----------------------------------------------
Wed Sep 11 15:39:15 2024 Phase: Running action
Wed Sep 11 15:39:15 2024 ----------------------------------------------
Wed Sep 11 15:39:15 2024 Running command powershell.exe -NonInteractive -File C:\ProgramData\Amazon\OpenJD\sample_session4n3p_urq\tmpz2wddzli.ps1
Wed Sep 11 15:39:15 2024 Command started as pid: 24984
Wed Sep 11 15:39:15 2024 Output:
Wed Sep 11 15:39:17 2024 Waiting 0
Wed Sep 11 15:39:18 2024 Waiting 1
Wed Sep 11 15:39:19 2024 Waiting 2
Wed Sep 11 15:39:20 2024 Waiting 3
Wed Sep 11 15:39:21 2024 Waiting 4
Wed Sep 11 15:39:22 2024 Waiting 5
Wed Sep 11 15:39:23 2024 Waiting 6
Wed Sep 11 15:39:24 2024 Waiting 7
Wed Sep 11 15:39:25 2024 Waiting 8
Wed Sep 11 15:39:26 2024 Waiting 9
Wed Sep 11 15:39:27 2024 Exiting script.
Wed Sep 11 15:39:27 2024 Interruption signal recieved.
Wed Sep 11 15:39:27 2024 Open Job Description CLI: Cancelling the session...
Wed Sep 11 15:39:27 2024 Open Job Description CLI: Session terminated by user while running action: 'Run Step 'Run' with Task parameters '{}''.
Wed Sep 11 15:39:27 2024 Open Job Description CLI: ERROR executing action: 'Run Step 'Run' with Task parameters '{}'' (see Task logs for details)
Wed Sep 11 15:39:27 2024 Open Job Description CLI: Local Session ended! Now cleaning up Session resources.
--- Results of local session ---
Session ended with errors; see Task logs for details
Job: Python script
Step: Run
Duration: 11.469836800009944 seconds
Tasks run: 1
Environment
At minimum:
- Operating system: Windows
- Output of
python3 --version: Python 3.9.13 - Version of your openjd-cli package (see:
pip show openjd-cli): Tested with0.4.0and0.4.4.
I also tried changing the version of openjd-sessions down to 0.5.0 and the behavior was the same, so I don't believe this is recently introduced.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working