composer: Composer 2 doesn't handle ctrl+c (SIGINT) immediately

Output of composer diagnose:

Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com oauth access: OK
Checking disk free space: OK
Checking pubkeys: 
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0  87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B  0C708369 153E328C AD90147D AFE50952
OK
Checking composer version: OK
Composer version: 2.0.4
PHP version: 7.2.34
PHP binary path: /usr/bin/php7.2
OpenSSL version: OpenSSL 1.1.1g  21 Apr 2020
cURL version: 7.58.0 libz 1.2.11 ssl OpenSSL/1.1.1g
zip extension: OK

When I press ctrl+c during composer update, it waits for the package to be completely downloaded before termination. I expect it to immediately stop the download process, clean any partially downloaded package and terminate. The current behaviour is inconvenient. I had wrong auth configuration and composer update --no-interaction was downloading all the packages by git clone which took too long, so I had to terminate it and fix auth configs, but I couldn’t do so. It didn’t even detect the connection loss when I turned off my wifi 😦 so I was forced to kill -9 and restart my computer 😦 and clean the cache.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 19 (10 by maintainers)

Most upvoted comments

Ok thanks, the good news is I have found a way to reproduce this. The bad news is I am not sure how to fix yet 😉 But we’ll see. At least it’s not a mystery anymore.