{"action":"closed","issue":{"url":"https://api.github.com/repos/scrapy/scrapy/issues/1279","labels_url":"https://api.github.com/repos/scrapy/scrapy/issues/1279/labels{/name}","comments_url":"https://api.github.com/repos/scrapy/scrapy/issues/1279/comments","events_url":"https://api.github.com/repos/scrapy/scrapy/issues/1279/events","html_url":"https://github.com/scrapy/scrapy/issues/1279","id":84752541,"number":1279,"title":"to stop CrawlerProcess started with stop_after_crawl=False two Ctrl-Cs are required","user":{"login":"kmike","id":107893,"avatar_url":"https://avatars.githubusercontent.com/u/107893?v=3","gravatar_id":"","url":"https://api.github.com/users/kmike","html_url":"https://github.com/kmike","followers_url":"https://api.github.com/users/kmike/followers","following_url":"https://api.github.com/users/kmike/following{/other_user}","gists_url":"https://api.github.com/users/kmike/gists{/gist_id}","starred_url":"https://api.github.com/users/kmike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kmike/subscriptions","organizations_url":"https://api.github.com/users/kmike/orgs","repos_url":"https://api.github.com/users/kmike/repos","events_url":"https://api.github.com/users/kmike/events{/privacy}","received_events_url":"https://api.github.com/users/kmike/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-03T20:15:32Z","updated_at":"2015-06-09T14:21:25Z","closed_at":"2015-06-09T14:21:25Z","body":"When CrawlerProcess is started with `stop_after_crawl=True` (default) and user presses Ctrl-C the following happens:\r\n\r\n1. Ctrl-C signal handler is changed to \"unclean shutown\" so that second Ctrl-C will definitely stop the reactor;\r\n2. `self.stop` method is called which asks all crawlers to stop;\r\n3. when all crawlers are stopped a Deferred returned from `self.join()` executes its callback. This callback is set to \"stop reactor\", so the reactor stops.\r\n\r\nBut with `crawler_process.start(stop_after_crawl=False)` there is no step (3) because `self.join` is not used. It means that to stop CrawlerProcess user have to send signal (press Ctrl-C) twice. The first Ctrl-C only asks all current crawlers to stop.\r\n\r\nI think it is better to change it - a signal should mean \"graceful shutdown\" regardless of `stop_after_crawl` option."}}