Mongrel not being stopped with CTRL-C under Windows

43 views
Skip to first unread message

Charles Roper

unread,
Mar 20, 2010, 10:32:09 AM3/20/10
to RubyInstaller
Today I ran into the issue described here:

https://rails.lighthouseapp.com/projects/8994/tickets/2088-mongrel-not-being-stopped-with-ctrl-c-under-windows

and here:

http://groups.google.com/group/rack-devel/browse_thread/thread/cb46925a2ed96721

I'm seeing this behaviour in Staticmatic[1] when I do "staticmatic
preview ."

I applied the patch found on lighthouse and it fixed the issue. Someone
at the end of the thread said the problem might be related to older
mswin builds, but I'm seeing this in my mingw versions.

Thoughts, anyone? Would be good to get that patch rolled into rack if it
is an appropriate fix.

[1] http://github.com/staticmatic/staticmatic

Charles

Brian Hogan

unread,
Mar 20, 2010, 11:38:01 AM3/20/10
to rubyin...@googlegroups.com
This has been a problem for me for about a year, with the current rubyinstaller and the one-click installer. It was not a problem until last year though - a later build of the one click rubhy installer caused it. Earlier builds from two years ago did not.

That's not very helpful, but it would be something I'd love to see fixed.


--
You received this message because you are subscribed to the Google Groups "RubyInstaller" group.
To post to this group, send email to rubyin...@googlegroups.com.
To unsubscribe from this group, send email to rubyinstalle...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyinstaller?hl=en.


Charles Roper

unread,
Mar 20, 2010, 11:55:50 AM3/20/10
to rubyin...@googlegroups.com
On 20/03/2010 15:38, Brian Hogan wrote:
> That's not very helpful, but it would be something I'd love to see fixed.

Actually, it is helpful because the more people that come forward and
talk about it, the more attention it gets and the more likely it is to
get properly fixed. It also helps others who are suffering the same
problem and are searching for a fix.

Charles

Luis Lavena

unread,
Mar 20, 2010, 6:54:25 PM3/20/10
to rubyin...@googlegroups.com

The problem is that basically INT is not being handled properly under Windows.

mongrel_rails is quite capable of receiving the message and stopping
the server, the problem is rack and script/server and they way they
hook up or trap INT.

This has nothing to do with Visual C old or new or MinGW.
--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry

Charles Roper

unread,
Mar 20, 2010, 7:39:02 PM3/20/10
to rubyin...@googlegroups.com
On 20/03/2010 22:54, Luis Lavena wrote:
> mongrel_rails is quite capable of receiving the message and stopping
> the server, the problem is rack and script/server and they way they
> hook up or trap INT.

The patch posted on Lighthouse is taken from Mongrel. Is this the
recommended workaround? It works for me.

http://s3.amazonaws.com/activereload-lighthouse/assets/b365e49466fd2d4af14d3a62d52654eb2948e2af/rack-handler-mongrel-win32-fix.diff?AWSAccessKeyId=1AJ9W2TX1B2Z7C2KYB82&Expires=1269128339&Signature=9l6b5%2F1PlLxKQiRxiSwYMRNDpaM%3D

> This has nothing to do with Visual C old or new or MinGW.

No, I didn't think it would be, but I thought you'd be able to give a
definitive answer on it. :)

Shall I reply to those threads with this info? Shall I recommend they
apply that patch?

Thanks Luis.

Charles

Luis Lavena

unread,
Mar 20, 2010, 7:50:15 PM3/20/10
to rubyin...@googlegroups.com
On Sun, Mar 21, 2010 at 12:39 AM, Charles Roper
<rea...@charlesroper.co.uk> wrote:
> On 20/03/2010 22:54, Luis Lavena wrote:
>>
>> mongrel_rails is quite capable of receiving the message and stopping
>> the server, the problem is rack and script/server and they way they
>> hook up or trap INT.
>
> The patch posted on Lighthouse is taken from Mongrel. Is this the
> recommended workaround? It works for me.
>
> <snip expired link>

The trap of INT is correct, but dunno the utility/usefulness of the
dummy thread.

The trap in the right place should be caught even when a socket is listening.

>
>> This has nothing to do with Visual C old or new or MinGW.
>
> No, I didn't think it would be, but I thought you'd be able to give a
> definitive answer on it. :)
>
> Shall I reply to those threads with this info? Shall I recommend they apply
> that patch?
>

Well, I think this should be fixed in Rack too, not just Rails. Rails
has the problem with script/server, but Rack has the problem running
with any adapter on Windows, not just mongrel.

Regards,

Reply all
Reply to author
Forward
0 new messages