-
Notifications
You must be signed in to change notification settings - Fork 47
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
--on-error=ask: wait for the user input #226
base: main
Are you sure you want to change the base?
Conversation
Hi @edigaryev thanks for opening up this change request. It is unlikely that we will accept this PR that removes the cancellation altogether because we don't want Packer to sit and wait around indefinitely. When running with I can see your rationale about 100 milliseconds not being enough time so I think we could consider bumping the wait time a little but not remove it. That said, looking at the linked Tart PR. If a user is cancelling the Packer run with CTRL-C I would expect the behavior being reported, Packer deletes anything it created. If the users wishes to debug a created VM they can use the If you believe bumping the wait time is not enough please open an issue with your use case so that we can better understand what you are trying to solve by running a Packer build with |
So pressing Ctrl+C does not constitute an error, and as a result That's unfortunate, as a user pressing Cltr+C may in many cases be because there was (semantically) an error during the provisioning e.g., that was not reported back as a failure. As the default option for If that's not an option, then Packer should at least skip the whole
|
The Packer already sits and waits around indefinitely with the current logic in place, so no change here:
I'll pass this to @sparshev here, as he was the one who was requesting this But overall I think this is a bad UX and needs to be fixed either way. |
Sorry @edigaryev , but it looks like miscommunication, my original request was about the Tart VM stops immediately in case I press Ctrl-C even with --on-error=ask. With VMX packer plugin I did not saw this happening, so I suspect Int signal is somehow passed to the Tart VM process through the packer and plugin or the process is killed due to out of scope. Quite sure it's not the issue with the packer or sdk. So I will test tart packer plugin again in the near future and come back with an ticket or will not in case it's working as expected - maybe the latest changes for cleanup are working and preventing Int signal to be passed to Tart VM, so still will need to test the latest plugin. |
@nywilken Please reconsider this PR. This is the current behavior of Packer when pressing Ctrl+C: With explicit
With explicit
With explicit
But, regardless of what the answer is:
My expectation is that the behavior of It there something missing on the Tart Packer plugin to support this? Or is it a bug in Packer that the command-line vs |
Problem: currently, when using
--on-error=ask
it picks a defaultaskCleanup
value if the user hasn't provided an input after 100 milliseconds, which seems to be almost impossible to do as a human.Solution: simplify the logic and fully wait for the user's input when
--on-error=ask
is specified.