Merge lp:~mm-yuhu/gearmand/server-funcs into lp:gearmand/1.0
Proposed by
HackMan
Status: | Rejected |
---|---|
Rejected by: | Brian Aker |
Proposed branch: | lp:~mm-yuhu/gearmand/server-funcs |
Merge into: | lp:gearmand/1.0 |
Diff against target: |
38 lines (+28/-0) 1 file modified
libgearman-server/server.c (+28/-0) |
To merge this branch: | bzr merge lp:~mm-yuhu/gearmand/server-funcs |
Related bugs: | |
Related blueprints: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gearman-developers | Pending | ||
Review via email: mp+21142@code.launchpad.net |
Description of the change
Every now and then during development one hit a situation where a client connects to a job server and requests a function to be executed. If the client uses dispatch_background then the server will wait depending on the configuration for a worker to do the job.
However in my case the client has issued wrong arguments and I don't want to connect the worker before removing the wrong requests and I don't want to restart the job server just for that.
This patch introduces a new command rmfunc which has only one argument, the function name that we want to remove. If there are connected workers, for this function we do not allow removing of the function.
To post a comment you must log in.
Hi!
A couple of things:
1) strcasecmp() is not found on all platforms.
2) We need a test case.
Thanks!
-Brian
On Mar 11, 2010, at 5:22 AM, HackMan wrote:
> HackMan has proposed merging lp:~mm-yuhu/gearmand/mm-dev into developers) /code.launchpad .net/~mm- yuhu/gearmand/ mm-dev/ +merge/ 21142 server/ server. c' server/ server. c 2010-01-28 21:45:14 +0000 server/ server. c 2010-03-11 13:22:17 +0000 "rmfunc" , (char *)(packet- >arg[0] ))) TEXT_RESPONSE_ SIZE, "ERR set+of+ arguments+ was+sent+ to+this+ command\ n"); con->thread- >server- >function_ list; function- >function_ name, (char *)(packet- >worker_ count == 0 ) server_ function_ free(function) ; TEXT_RESPONSE_ SIZE, "OK\n"); TEXT_RESPONSE_ SIZE, "ERR there "maxqueue" , (char *)(packet- >arg[0] )))
> lp:gearmand.
>
> Requested reviews:
> Gearman-developers (gearman-
>
>
> Every now and then during development one hit a situation where a
> client connects to a job server and requests a function to be
> executed. If the client uses dispatch_background then the server
> will wait depending on the configuration for a worker to do the job.
>
> However in my case the client has issued wrong arguments and I don't
> want to connect the worker before removing the wrong requests and I
> don't want to restart the job server just for that.
>
> This patch introduces a new command rmfunc which has only one
> argument, the function name that we want to remove. If there are
> connected workers, for this function we do not allow removing of the
> function.
> --
> https:/
> Your team Gearman-developers is subscribed to branch lp:gearmand.
> === modified file 'libgearman-
> --- libgearman-
> +++ libgearman-
> @@ -849,6 +849,34 @@
> if (size < total)
> snprintf(data + size, total - size, ".\n");
> }
> + else if (!strcasecmp(
> + {
> + if (packet->argc == 1)
> + {
> + snprintf(data, GEARMAN_
> incomplete_args "
> + "An+incomplete+
> + }
> + else
> + {
> + for (function= server_
> + function != NULL; function= function->next)
> + {
> + if (!strcasecmp(
> >arg[1])))
> + {
> + if ( function-
> + {
> + gearman_
> + snprintf(data, GEARMAN_
> + }
> + else
> + {
> + snprintf(data, GEARMAN_
> are still connected workers\n");
> + }
> + }
> + }
> + }
> + }
> +
> else if (!strcasecmp(
> {
> if (packet->argc == 1)
>