server didnt increase ttr to 1. when client sends 0

29 views
Skip to first unread message

Hoyoung Hwang

unread,
Dec 19, 2011, 9:36:48 PM12/19/11
to beansta...@googlegroups.com
in protocol document, 
..
 If the worker does not delete, release, or bury the job within
   <ttr> seconds, the job will time out and the server will release the job.
   The minimum ttr is 1. If the client sends 0, the server will silently
   increase the ttr to 1.
..

but the job which is 0-ttr is not increased by server.
(in "stat-job" command.)
And if the job is reserved, it is never released (before "release" called)
is that working right?

Message has been deleted

Hoyoung Hwang

unread,
Dec 20, 2011, 10:05:45 PM12/20/11
to beansta...@googlegroups.com

...
/* Read a timeout value from the given buffer and place it in ttr.
 * The interface and behavior are analogous to read_pri(). */
static int
read_ttr(usec *ttr, const char *buf, char **end)
{
    int r;
    unsigned int ttr_sec;

    r = read_pri(&ttr_sec, buf, end);
    if (r) return r;
    if (ttr_sec < 1) ttr_sec = 1;
    *ttr = ((usec) ttr_sec) * 1000000;
    return 0;
}
..

Keith Rarick

unread,
Jan 5, 2012, 7:57:36 PM1/5/12
to beansta...@googlegroups.com
Thanks for the report! I made a slightly different fix, to keep the
logic for altering ttr in the same place it was before.

https://github.com/kr/beanstalkd/commit/69c691b550dd34559674a733e3ed250a46181d5c

kr

On Tue, Dec 20, 2011 at 6:17 PM, Hoyoung Hwang <hwa...@gmail.com> wrote:
> prot.c  will be
> ....


> /* Read a timeout value from the given buffer and place it in ttr.

>  * The interface and behavior are the same as in read_delay(). */


> static int
> read_ttr(usec *ttr, const char *buf, char **end)
> {
>     int r;
>     unsigned int ttr_sec;
>
>     r = read_pri(&ttr_sec, buf, end);
>     if (r) return r;
>     if (ttr_sec < 1) ttr_sec = 1;
>     *ttr = ((usec) ttr_sec) * 1000000;
>     return 0;
> }

> ...
>
> --
> You received this message because you are subscribed to the Google Groups
> "beanstalk-talk" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/beanstalk-talk/-/dlkBxtwCCEMJ.
>
> To post to this group, send email to beansta...@googlegroups.com.
> To unsubscribe from this group, send email to
> beanstalk-tal...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/beanstalk-talk?hl=en.

Reply all
Reply to author
Forward
0 new messages