librelist archives

« back to archive

Mongrel2 v1.7.2 Is Out, Little Bug Fixes

Mongrel2 v1.7.2 Is Out, Little Bug Fixes

From:
Zed A. Shaw
Date:
2011-06-10 @ 16:16
This is just a quick announce of 1.7.2 that has a few little fixes here
and there from using it live and pull requests.  You can grab it at the
usual places:

http://mongrel2.org/home

And here's the direct download link:

http://mongrel2.org/static/downloads/mongrel2-1.7.2.tar.bz2

Let me know if you hit any other bugs and I'll roll up another release.

-- 
Zed A. Shaw
http://zedshaw.com/

Re: [mongrel2] Mongrel2 v1.7.2 Is Out, Little Bug Fixes

From:
Dalton Barreto
Date:
2011-06-11 @ 16:03
2011/6/10 Zed A. Shaw <zedshaw@zedshaw.com>:
>
> Let me know if you hit any other bugs and I'll roll up another release.

Hello Zed,

I just installed mongrel2-1.7.2 and I'm having some trouble here.

What I did was just upgrade the binaries and migrated the database
(use_ssl column and etc).
I have one wsgid instance running on my local machine and with the new
mongrel2 when I hit the URL I receive a Bad Gatweay response. Here is
the log:

First, the logs when running mongrel2-1.7.2:

daltonmatos@maya ~ [1]$ tail -f /var/mongrel2/logs/error.log
[INFO] (src/mongrel2.c:342) Starting Mongrel2/1.7.2. Copyright (C) Zed
A. Shaw. Licensed BSD.
[INFO] (src/server.c:272) Starting server on port 80
[INFO] (src/task/fd.c:151) MAX limits.fdtask_stack=102400
[INFO] (src/superpoll.c:102) Allowing for 2560 hot and 7680 idle file
descriptors (dividend was 4)
[INFO] (src/handler.c:209) MAX allowing limits.handler_targets=128
[INFO] (src/handler.c:280) Binding handler PUSH socket
tcp://127.0.0.1:5000 with identity:
e240f04a-acbd-414f-a1b3-e070644713d7
[INFO] (src/handler.c:306) Binding listener SUB socket
tcp://127.0.0.1:5001 subscribed to:
[INFO] (src/control.c:367) Setting up control socket in at ipc://run/control
[ERROR] (src/connection.c:179: errno: Resource temporarily
unavailable) Handler shutdown while trying to deliver: /trac
[ERROR] (src/connection.c:109: errno: Resource temporarily
unavailable) Handler not found: /favicon.ico
[ERROR] (src/connection.c:179: errno: Resource temporarily
unavailable) Handler shutdown while trying to deliver: /trac
[ERROR] (src/connection.c:109: errno: Resource temporarily
unavailable) Handler not found: /favicon.ico
[INFO] (src/mongrel2.c:83) SHUTDOWN REQUESTED: GRACEFUL (SIGINT again
to EXIT NOW)
[ERROR] (src/task/net.c:235: errno: Bad file descriptor) Failed to
accept after doing a poll on the socket.
[INFO] (src/mongrel2.c:353) Shutdown requested, goodbye.
[ERROR] (src/handler.c:180: errno: None) Receive on handler socket failed.
[ERROR] (src/control.c:57: errno: None) Receive on control failed.
[ERROR] (src/control.c:379: errno: None) Failed to read message: Success.
[INFO] (src/control.c:404) Control port exiting with error.
[INFO] (src/mongrel2.c:281) Shutting down all running tasks as
gracefully as possible.

From now on, is mongrel2-1.6.
Note: I didn't restarted the wsgid instance between mongrel2 downgrade.

[INFO] (src/mongrel2.c:289) Tasks now running (including main task): 1
[INFO] (src/mongrel2.c:298) Removing pid file /run/mongrel2.pid
[INFO] (src/unixy.c:83) Now running as UID:1000, GID:1000
[INFO] (src/server.c:166) Starting 0MQ with 1 threads.
[INFO] (src/request.c:56) MAX limits.header_count=1280
[INFO] (src/connection.c:704) MAX limits.content_length=20480,
limits.buffer_size=4096, limits.connection_stack_size=32768,
limits.client_read_retries=5
[INFO] (src/connection.c:710) MAX limits.proxy_read_retries=100,
limits.proxy_read_retry_warn=10
[INFO] (src/mongrel2.c:323) Starting Mongrel2/1.6-0845f67726.
Copyright (C) Zed A. Shaw. Licensed BSD.
[INFO] (src/server.c:181) Starting server on port 80
[INFO] (src/task/fd.c:135) MAX limits.fdtask_stack=102400
[INFO] (src/superpoll.c:102) Allowing for 2560 hot and 7680 idle file
descriptors (dividend was 4)
[INFO] (src/control.c:375) Setting up control socket in at ipc://run/control
[INFO] (src/handler.c:213) MAX allowing limits.handler_targets=128
[INFO] (src/handler.c:281) Binding handler PUSH socket
tcp://127.0.0.1:5000 with identity:
e240f04a-acbd-414f-a1b3-e070644713d7
[INFO] (src/handler.c:303) Binding listener SUB socket
tcp://127.0.0.1:5001 subscribed to:
[WARN] (src/register.c:319: errno: Resource temporarily unavailable)
Killed 3 connections according to min_ping: 120, min_write_rate: 300,
min_read_rate: 300
[WARN] (src/mongrel2.c:186: errno: Resource temporarily unavailable)
Timeout task killed 3 tasks, waiting 10 seconds for more.
[WARN] (src/register.c:319: errno: Resource temporarily unavailable)
Killed 1 connections according to min_ping: 120, min_write_rate: 300,
min_read_rate: 300
[WARN] (src/mongrel2.c:186: errno: Resource temporarily unavailable)
Timeout task killed 1 tasks, waiting 10 seconds for more.

All works fine with mongrel2-1.6 and the same wsgid instance.

I will look further into this problem, but if you know anything that
could be causing this, let me know!

Note: I didn't test mongrel2-1.7.2 with the example handler, I will do
this and report back.

Thanks!

-- 
Dalton Barreto
http://daltonmatos.wordpress.com
http://wsgid.com

Re: [mongrel2] Mongrel2 v1.7.2 Is Out, Little Bug Fixes

From:
Dalton Barreto
Date:
2011-06-11 @ 16:26
2011/6/11 Dalton Barreto <daltonmatos@gmail.com>:
> Note: I didn't test mongrel2-1.7.2 with the example handler, I will do
> this and report back.

Seems to be the same. I installed the python examples and used a very
basic handler. Received the same Bad Gateway response. Here is the
handler code:


from mongrel2 import handler
import json
import time
import urllib

sender_id = "e240f04a-acbd-414f-a1b3-e070644713d7"


conn = handler.Connection(sender_id, "tcp://127.0.0.1:5000", # 9998
                          "tcp://127.0.0.1:5001") # 9999
while True:
    req = conn.recv()
    if req.is_disconnect():
        print "DISCONNECT"
        continue

    response = json.dumps(req.headers, indent=2)
    print req.path, req.conn_id

    conn.reply_http(req, response)



I made the same tests as before, mongrel2-1.6 works fine.
Let me know if I missed something.

Thanks!

-- 
Dalton Barreto
http://daltonmatos.wordpress.com
http://wsgid.com

Re: [mongrel2] Mongrel2 v1.7.2 Is Out, Little Bug Fixes

From:
Zed A. Shaw
Date:
2011-06-11 @ 17:03
On Sat, Jun 11, 2011 at 01:26:03PM -0300, Dalton Barreto wrote:
> 2011/6/11 Dalton Barreto <daltonmatos@gmail.com>:
> > Note: I didn't test mongrel2-1.7.2 with the example handler, I will do
> > this and report back.
> 
> Seems to be the same. I installed the python examples and used a very
> basic handler. Received the same Bad Gateway response. Here is the
> handler code:

This might be similar to a bug galdor found where handlers have problems
sharing routes.  Can you send me your mongrel2.conf as well? (Off list).

I'll be working on it today.

-- 
Zed A. Shaw
http://zedshaw.com/

Re: [mongrel2] Mongrel2 v1.7.2 Is Out, Little Bug Fixes

From:
Dalton Barreto
Date:
2011-06-11 @ 18:26
2011/6/11 Zed A. Shaw <zedshaw@zedshaw.com>:
> On Sat, Jun 11, 2011 at 01:26:03PM -0300, Dalton Barreto wrote:
>> 2011/6/11 Dalton Barreto <daltonmatos@gmail.com>:
>> > Note: I didn't test mongrel2-1.7.2 with the example handler, I will do
>> > this and report back.
>>
>> Seems to be the same. I installed the python examples and used a very
>> basic handler. Received the same Bad Gateway response. Here is the
>> handler code:
>
> This might be similar to a bug galdor found where handlers have problems
> sharing routes.  Can you send me your mongrel2.conf as well? (Off list).

Just sent it to your email.

Thanks!


-- 
Dalton Barreto
http://daltonmatos.wordpress.com
http://wsgid.com

Re: [mongrel2] Mongrel2 v1.7.2 Is Out, Little Bug Fixes

From:
Zed A. Shaw
Date:
2011-06-11 @ 18:02
On Sat, Jun 11, 2011 at 01:26:03PM -0300, Dalton Barreto wrote:
> 2011/6/11 Dalton Barreto <daltonmatos@gmail.com>:
> > Note: I didn't test mongrel2-1.7.2 with the example handler, I will do
> > this and report back.
> 
> Seems to be the same. I installed the python examples and used a very
> basic handler. Received the same Bad Gateway response. Here is the
> handler code:

Alright, this should be fixed now.  The problem was in the config
loading code and how it handled multiple routes pointed at one handler.
I thought I had it so that it would point them at the same one, but
totally screwed up the logic.  Now it loads one handler but points it at
each route, and I've got a test case in
examples/configs/mulit_handler.conf for the future.

Try the latest develop and let me know if that fixes your issue.

-- 
Zed A. Shaw
http://zedshaw.com/

Re: [mongrel2] Mongrel2 v1.7.2 Is Out, Little Bug Fixes

From:
Dalton Barreto
Date:
2011-06-11 @ 18:25
2011/6/11 Zed A. Shaw <zedshaw@zedshaw.com>:
> On Sat, Jun 11, 2011 at 01:26:03PM -0300, Dalton Barreto wrote:
>> 2011/6/11 Dalton Barreto <daltonmatos@gmail.com>:
>> > Note: I didn't test mongrel2-1.7.2 with the example handler, I will do
>> > this and report back.
>>
>> Seems to be the same. I installed the python examples and used a very
>> basic handler. Received the same Bad Gateway response. Here is the
>> handler code:
>
> Alright, this should be fixed now.  The problem was in the config
> loading code and how it handled multiple routes pointed at one handler.
> I thought I had it so that it would point them at the same one, but
> totally screwed up the logic.  Now it loads one handler but points it at
> each route, and I've got a test case in
> examples/configs/mulit_handler.conf for the future.
>
> Try the latest develop and let me know if that fixes your issue.

Fixed! Thank you very much!

-- 
Dalton Barreto
http://daltonmatos.wordpress.com
http://wsgid.com