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

SIGINT (CTRL+C) returns to shell immediately #95

Closed
stephan242 opened this issue Apr 5, 2024 · 1 comment · Fixed by #97
Closed

SIGINT (CTRL+C) returns to shell immediately #95

stephan242 opened this issue Apr 5, 2024 · 1 comment · Fixed by #97
Assignees
Labels
bug Something isn't working

Comments

@stephan242
Copy link

Describe the bug
When running the tenv replacement for native tofu or terraform, and sending a SIGINT signal to it (by pressing CTRL+C), then the parent tenv gets killed immediately, and gives back a shell, while the underlying native tofu or terraform continues running, and sending data into the shell.

This also means one can't easily force a graceless (disgraceful?) shutdown with a second CTRL+C anymore.

module.d1.argocd_application.engine: Still creating... [3m30s elapsed]
module.d1.argocd_application.service: Still creating... [3m50s elapsed]
module.d1.argocd_application.engine: Still creating... [3m40s elapsed]
module.d1.argocd_application.service: Still creating... [4m0s elapsed]
module.d1.argocd_application.engine: Still creating... [3m50s elapsed]
module.d1.argocd_application.service: Still creating... [4m10s elapsed]
module.d1.argocd_application.engine: Still creating... [4m0s elapsed]
^CStopping operation...

Interrupt received.
Please wait for OpenTofu to exit or data loss may occur.
Gracefully shutting down...


fred@machine qa % 
fred@machine qa % module.d1.argocd_application.service: Still creating... [4m20s elapsed]
module.d1.argocd_application.engine: Still creating... [4m10s elapsed]

fred@machine qa % module.d1.argocd_application.service: Still creating... [4m30s elapsed]
module.d1.argocd_application.engine: Still creating... [4m20s elapsed]

fred@machine qa % module.d1.argocd_application.service: Still creating... [4m40s elapsed]
module.d1.argocd_application.engine: Still creating... [4m30s elapsed]
module.d1.argocd_application.service: Still creating... [4m50s elapsed]
module.d1.argocd_application.engine: Still creating... [4m40s elapsed]
module.d1.argocd_application.engine: Still creating... [4m50s elapsed]

To Reproduce
Steps to reproduce the behavior:

  1. Run tenv's terraform or tofu for a longer run
  2. hit CTRL+C, even numerous times
  3. Note you get your prompt back

Expected behavior
The same as if I run terraform or tofu natively. First CTRL+C - graceful shutdown, no prompt. Second CTRL+C: Immediate shutdown.

Btw. this was working fine with tfenv.

@kvendingoldo kvendingoldo added the bug Something isn't working label Apr 5, 2024
@kvendingoldo
Copy link
Collaborator

Thanks for reporting, we'll check it

@dvaumoron dvaumoron self-assigned this Apr 5, 2024
dvaumoron added a commit that referenced this issue Apr 5, 2024
Signed-off-by: Denis Vaumoron <dvaumoron@gmail.com>
dvaumoron added a commit that referenced this issue Apr 5, 2024
Signed-off-by: Denis Vaumoron <dvaumoron@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants