Browse Source

Continue merge from main branch

Wang Lam 13 years ago
parent
commit
a1f242c3a3
3 changed files with 5 additions and 16 deletions
  1. 1 1
      libgearman-server/job.c
  2. 1 1
      libgearman-server/server.c
  3. 3 14
      libgearman/client.cc

+ 1 - 1
libgearman-server/job.c

@@ -156,7 +156,7 @@ gearman_server_job_add_reducer(gearman_server_st *server,
 
   if (server_job == NULL)
   {
-    gearmand_log_debug("Comparing queue %u to limit %u for priority %u",
+    gearmand_log_debug(GEARMAN_DEFAULT_LOG_PARAM, "Comparing queue %u to limit %u for priority %u",
       server_function->job_total, server_function->max_queue_size[priority],
       priority);
     if (server_function->max_queue_size[priority] > 0 &&

+ 1 - 1
libgearman-server/server.c

@@ -1096,7 +1096,7 @@ static gearmand_error_t _server_run_text(gearman_server_con_st *server_con,
             !memcmp(packet->arg[1], function->function_name,
                     function->function_name_size))
         {
-          gearmand_log_debug("Applying queue limits to %s",
+          gearmand_log_debug(GEARMAN_DEFAULT_LOG_PARAM, "Applying queue limits to %s",
                              function->function_name);
           memcpy(function->max_queue_size, max_queue_size,
                  sizeof(uint32_t) * GEARMAND_JOB_PRIORITY_MAX);

+ 3 - 14
libgearman/client.cc

@@ -1076,24 +1076,13 @@ static inline gearman_return_t _client_run_tasks(gearman_client_st *client)
 
                 /* Packet cleanup copied from "Clean up the packet" below, and must
                    remain in sync with its reference. */
-                gearman_packet_free(&(client->con->packet));
+                gearman_packet_free(&(client->con->_packet));
                 client->con->options.packet_in_use= false;
 
-                /* This step copied from _client_run_tasks(): */
-                /* Increment this since the job submission failed. */
+                /* This step copied from _client_run_tasks() above: */
+                /* Increment this value because new job created then failed. */
                 client->con->created_id++;
 
-                /* Task cleanup copied from bottom of _client_run_tasks(), and must
-                   remain in sync with its reference. */
-		/* Actually, caller already tries to gearman_task_free(...) */
-		/*
-                client->running_tasks--;
-                client->task->state= GEARMAN_TASK_STATE_FINISHED;
-
-                if (client->options.free_tasks)
-                  gearman_task_free(client->task);
-		*/
-
                 return GEARMAN_SERVER_ERROR;
               }
               else if (strncmp(client->task->job_handle,