Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Mongrel not being stopped with CTRL-C under Windows

#2088

Because of the way Rack::Handler::Mongrel instantiates the Mongrel::HttpHandler, it becomes impossible to shutdown the server with CTRL-C unless one actually enters CTRL-C and then hits the (still running) server.

This seems to be a Windows-only issue.

Attached is a patch which fixes this issue. This solution comes from the Mongrel gem source code.

Reported by C. Bedard · February 26th, 2009 @ 08:17 PM

State: stale
Milestone: 3.x
Assigned to: nobody
Importance: none

Activity

  1. James Herdman
    James Herdman
    • Tag changed from 2.3-rc1, mongrel, rack, server, windows to 2.3.2, mongrel, rack, server, windows

    May I suggest submitting this patch to the Rack team? It might be more applicable there.

    April 6th, 2009 @ 09:39 PM

  2. mkosma
    mkosma

    Running rails via gem 2.3.2. (Also have installed the gem for mongrel 1.1.5, but I take it that appears elsewhere.) I can confirm the problematic behavior described, and confirm that this patch fixes the silly mongrel.

    I manually applied the patch by adding the two new lines (trap & sleeper_thread) to mongrel.rb in c:\ruby\lib\ruby\gems\1.8\gems\actionpack-2.3.2\lib\action_controller\vendor\rack-1.0\rack\handler>.

    There must be a better way to manage patches like this. Googled a ton but found no answer that made sense. Do I need to get off the gems and start using git? freeze rails 2.3.2?

    Thoughts appreciated, or better yet a link as this is probably the wrong place for this question.

    May 11th, 2009 @ 01:34 AM

  3. raggi
    raggi

    I think this only affects the very old VS 6.0 builds, though?

    The bug is actually in IO blocking in the ruby interpreter itself.

    Update your compiler and interpreter, and the issue should go away.

    Can anyone confirm this (I'm relatively sure)?

    August 19th, 2009 @ 09:18 AM

  4. Charles Roper
    Charles Roper

    According to Luis Lavena, maintainer of RubyInstaller on Windows, this problem isn't related to the compiler. I can confirm the issue is still present on the newer mingw builds.

    Here's a thread discussing it:

    http://groups.google.com/group/rubyinstaller/browse_thread/thread/8...

    March 22nd, 2010 @ 05:54 PM

  5. Jeremy Kemper
    Jeremy Kemper
    • Milestone changed from 2.x to 3.x

    May 4th, 2010 @ 06:48 PM

  6. Santiago Pastorino
    Santiago Pastorino
    • State changed from new to open
    • Tag changed from 2.3.2, mongrel, rack, server, windows to server, 232, mongrel, rack, windows
    • Importance changed from to

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

    February 2nd, 2011 @ 04:53 PM

  7. Santiago Pastorino
    Santiago Pastorino
    • State changed from open to stale
    • Tag changed from server, 232, mongrel, rack, windows to server, 232, mongrel, rack, windows

    February 2nd, 2011 @ 04:53 PM