Hi,

I traced a minor bug. If I set a large time out value, e.g. 3000s, in
"reserved-with-timeout" command, the queue will return back to the
client immediately with "TIMED_OUT",  just the same effect as
"reserved-with-timeout 0".

I took some time to trace it. Seems like there is an overflow during
type conversion.   Here is a simple patch which can fix it
(pending_timeout is 'int', where overflow occurs after it multiplies
against SECOND):

diff --git a/conn.c b/conn.c
index 32f5f16..0d622af 100644
--- a/conn.c
+++ b/conn.c
@@ -160,7 +160,7 @@ conn_set_evq(conn c, const int events, evh
handler)
         should_timeout = 1;
     }
     if (c->pending_timeout >= 0) {
-        t = min(t, c->pending_timeout * SECOND);
+        t = min(t, ((usec)c->pending_timeout) * SECOND);
         should_timeout = 1;
     }
     if (should_timeout) timeval_from_usec(&tv, t);

-- 
You received this message because you are subscribed to the Google Groups 
"beanstalk-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/beanstalk-talk?hl=en.

Reply via email to