-
Notifications
You must be signed in to change notification settings - Fork 904
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
Correctly handle SIGINT / Control+C #619
Comments
I take a big issue with the statement "poor reasons". It sounds a bit negative, but I don't see anything on the issue you linked where the reasoning is stated for the current behavior. It was an inherited choice from the way that NuGet worked, so we emulated the behavior. We've realized that it is incorrect and have defined the boundary where this change will occur. It does take a major version boundary to adjust it for reasons you may not understand if you have not supported a large number of users in a software development project before. |
For the issue at hand, I often use Control+C, without it corrupting anything. What version of choco are you running? |
nod. i added -lo in the original chocolatey powershell product to improve it at a time when noone was using choco in the enterprise. Those and many other community driven contributions, whether good or bad (being judged now with 20/20 hindsight) have led to worldwide chocolatey adoption and usage. This has been quite a feat given the usage of open source in the windows world. Can things be improved, yes but improvements need not be promoted with negativity. So you know, to compare with other package managers:
apt-cache may handle it more intelligently but these types of features have to be added without breakage. for instance enterprise config management systems rely on functionality in the choco product, that will break if version change is not well coordinated. Those config mgmt systems, in addition need to maintain backward compatibility too w/ choco since everyone doesn't just upgrade big bang overnight. |
Granted. I still hugely favor the brew approach. But for the issue at hand, it's version 0.9.9.11. I usually have no problems with Control+C, except for the most recent time when it blew up on me. I think handling it and attempting to provide orderly termination would greatly improve the user experience. |
Yes I agree. The chances of corrupting the xml file are very slight in 0.9.9.11. Handling control+c differently when this file is being edited would be hugely beneficial. |
@ferventcoder What about handling it everywhere? This would prevent partial/broken installs if it's sent once during installation (permitting Chocolatey to roll back the installation). |
👍 on that. |
It would be very good to also make choco concurrent-safe. At least read-only operations should not break installations. I.e. while I'm installing or upgrading some packages I should be able to use |
@pyhedgehog you mean be able to run some commands without pending? The problem here is that non-local search is pretty much the only thing aside from help you could run.
We are discussing this at #683 |
Not sure - nothing stops me from downloading several files, also nothing stops me from unpacking several zip files in parallel. |
@pyhedgehog apologies, was referring to native installers |
"Native" cygwin installer can be run in parallel with any other. |
+1 for |
Handling SIGINT/Ctrl+C should be done in three stages:
|
@alexchandel I thought we had this discussion here already. However I don't see it on a quick scroll back, so 👍 |
Some reference that could possibly be implemented into the Chocolatey PS helper functions: https://blogs.technet.microsoft.com/dsheehan/2018/10/27/powershell-taking-control-over-ctrl-c/ I'd really love to see traction on this issue as I run into #1548 from time to time. My requested goal is that when an upgrade is aborted via ctrl-c, that Chocolatey would move the previous package files back from chocolatey\lib-bkp to chocolatey\lib so that the package isn't lost from package management. I see the "0 - _Triaging" label on this issue, but I believe it should be considered a proper bug. |
This is something I can reliably reproduce with newly installed choco. choco install miniconda3 see the prompt to install, remember I want -y: now I get that the package is already installed and I should use --force. Running the same command again actually installs without a fuss. |
Chocolatey currently prints the following hostile message when interrupted with Control+C:
But Control+C is often necessary. For example, for
poorvarious reasons,choco list
still lists every package on chocolatey. If you're on VM, or a slow connection, or in a subnet without internet, an accidentalchoco list
can consume substantial time and must be interrupted.Instead of doing this, why not simply handle the interrupt? On the first Control-C, Homebrew will silently begin to stop its tasks. On the second, it prints the message
Just a moment, cleaning up...
. And on the third Control-C, it immediately halts its tasks.Tasks
Additional Information
Zendesk Ticket
The text was updated successfully, but these errors were encountered: