gearman can't user redis as persistence queue

Bug #1390672 reported by linuxjcq
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Gearman
New
Undecided
Unassigned

Bug Description

below is my debug result, how can i fix, I can only use 127.0.0.1 as redis server address, other address failed like below,
# gearmand -l /dev/stdout --verbose=DEBUG -q redis --redis-server=10.131.177.82--redis-port=6379
  DEBUG 2014-11-07 02:48:53.457929 [ main ] THREADS: 4 -> libgearman-server/gearmand.cc:263
   INFO 2014-11-07 02:48:53.466437 [ main ] Initializing hiredis module
   INFO 2014-11-07 02:48:53.466446 [ main ] Initializing Gear on port 4730 with SSL: false
   INFO 2014-11-07 02:48:53.466493 [ main ] Starting up with pid 23439, verbose is set to DEBUG
  DEBUG 2014-11-07 02:48:53.466509 [ main ] staring up Epoch thread -> libgearman-server/timer.cc:61
  DEBUG 2014-11-07 02:48:53.466526 [ main ] Method for libevent: epoll -> libgearman-server/gearmand.cc:364
  DEBUG 2014-11-07 02:48:53.466604 [ main ] Trying to listen on 0.0.0.0:4730 -> libgearman-server/gearmand.cc:646
   INFO 2014-11-07 02:48:53.466621 [ main ] Listening on 0.0.0.0:4730 (10)
  DEBUG 2014-11-07 02:48:53.466627 [ main ] Trying to listen on :::4730 -> libgearman-server/gearmand.cc:646
   INFO 2014-11-07 02:48:53.466639 [ main ] Listening on :::4730 (11)
  DEBUG 2014-11-07 02:48:53.466646 [ main ] Creating wakeup pipe -> libgearman-server/gearmand.cc:915
  DEBUG 2014-11-07 02:48:53.466652 [ main ] Creating 4 threads -> libgearman-server/gearmand.cc:378
  DEBUG 2014-11-07 02:48:53.466661 [ main ] Initializing libevent for IO thread -> libgearman-server/gearmand_thread.cc:224
  DEBUG 2014-11-07 02:48:53.466678 [ main ] Creating IO thread wakeup pipe -> libgearman-server/gearmand_thread.cc:495
  DEBUG 2014-11-07 02:48:53.466724 [ main ] Thread 1 created -> libgearman-server/gearmand_thread.cc:273
  DEBUG 2014-11-07 02:48:53.466826 [ main ] Initializing libevent for IO thread -> libgearman-server/gearmand_thread.cc:224
  DEBUG 2014-11-07 02:48:53.466846 [ 1 ] Entering thread event loop -> libgearman-server/gearmand_thread.cc:463
  DEBUG 2014-11-07 02:48:53.466854 [ main ] Creating IO thread wakeup pipe -> libgearman-server/gearmand_thread.cc:495
  DEBUG 2014-11-07 02:48:53.466966 [ main ] Thread 2 created -> libgearman-server/gearmand_thread.cc:273
  DEBUG 2014-11-07 02:48:53.467049 [ main ] Initializing libevent for IO thread -> libgearman-server/gearmand_thread.cc:224
  DEBUG 2014-11-07 02:48:53.466991 [ 2 ] Entering thread event loop -> libgearman-server/gearmand_thread.cc:463
  DEBUG 2014-11-07 02:48:53.467069 [ main ] Creating IO thread wakeup pipe -> libgearman-server/gearmand_thread.cc:495
  DEBUG 2014-11-07 02:48:53.467118 [ main ] Thread 3 created -> libgearman-server/gearmand_thread.cc:273
  DEBUG 2014-11-07 02:48:53.467125 [ main ] Initializing libevent for IO thread -> libgearman-server/gearmand_thread.cc:224
  DEBUG 2014-11-07 02:48:53.467162 [ main ] Creating IO thread wakeup pipe -> libgearman-server/gearmand_thread.cc:495
  DEBUG 2014-11-07 02:48:53.467177 [ 3 ] Entering thread event loop -> libgearman-server/gearmand_thread.cc:463
  DEBUG 2014-11-07 02:48:53.467226 [ main ] Thread 4 created -> libgearman-server/gearmand_thread.cc:273
  DEBUG 2014-11-07 02:48:53.467233 [ main ] replaying queue: begin -> libgearman-server/gearmand.cc:391
   INFO 2014-11-07 02:48:53.467237 [ main ] hiredis replay start
  ERROR 2014-11-07 02:48:53.467269 [ main ] Failed to call KEYS during QUEUE replay _hiredis_replay(QUEUE_ERROR) -> libgearman-server/plugins/queue/redis/queue.cc:258
  ERROR 2014-11-07 02:48:53.467280 [ main ] failed to reload queue gearmand_run(QUEUE_ERROR) -> libgearman-server/gearmand.cc:395
  DEBUG 2014-11-07 02:48:53.467283 [ main ] shutting down Epoch thread -> libgearman-server/timer.cc:124
  DEBUG 2014-11-07 02:48:53.467281 [ 4 ] Entering thread event loop -> libgearman-server/gearmand_thread.cc:463
  DEBUG 2014-11-07 02:48:53.467376 [ main ] shutdown of Epoch completed -> libgearman-server/timer.cc:155
   INFO 2014-11-07 02:48:53.467383 [ main ] Closing listening socket (10)
   INFO 2014-11-07 02:48:53.467392 [ main ] Closing listening socket (11)
  DEBUG 2014-11-07 02:48:53.467398 [ main ] Closing wakeup pipe -> libgearman-server/gearmand.cc:951
  DEBUG 2014-11-07 02:48:53.467403 [ main ] Shutting down all threads -> libgearman-server/gearmand.cc:276
  DEBUG 2014-11-07 02:48:53.467406 [ main ] Shutting down thread 4 -> libgearman-server/gearmand_thread.cc:284
  DEBUG 2014-11-07 02:48:53.467430 [ 4 ] Received SHUTDOWN wakeup event -> libgearman-server/gearmand_thread.cc:614
  DEBUG 2014-11-07 02:48:53.467436 [ 4 ] Clearing event for IO thread wakeup pipe 4 -> libgearman-server/gearmand_thread.cc:551
  DEBUG 2014-11-07 02:48:53.467442 [ 4 ] Exiting thread event loop -> libgearman-server/gearmand_thread.cc:471
  DEBUG 2014-11-07 02:48:53.467466 [ main ] Closing IO thread wakeup pipe -> libgearman-server/gearmand_thread.cc:539
  DEBUG 2014-11-07 02:48:53.467516 [ main ] Thread 4 shutdown complete -> libgearman-server/gearmand_thread.cc:369
  DEBUG 2014-11-07 02:48:53.467522 [ main ] Shutting down thread 3 -> libgearman-server/gearmand_thread.cc:284
  DEBUG 2014-11-07 02:48:53.467541 [ 3 ] Received SHUTDOWN wakeup event -> libgearman-server/gearmand_thread.cc:614
  DEBUG 2014-11-07 02:48:53.467547 [ 3 ] Clearing event for IO thread wakeup pipe 3 -> libgearman-server/gearmand_thread.cc:551
  DEBUG 2014-11-07 02:48:53.467551 [ 3 ] Exiting thread event loop -> libgearman-server/gearmand_thread.cc:471
  DEBUG 2014-11-07 02:48:53.467589 [ main ] Closing IO thread wakeup pipe -> libgearman-server/gearmand_thread.cc:539
  DEBUG 2014-11-07 02:48:53.467602 [ main ] Thread 3 shutdown complete -> libgearman-server/gearmand_thread.cc:369
  DEBUG 2014-11-07 02:48:53.467606 [ main ] Shutting down thread 2 -> libgearman-server/gearmand_thread.cc:284
  DEBUG 2014-11-07 02:48:53.467625 [ 2 ] Received SHUTDOWN wakeup event -> libgearman-server/gearmand_thread.cc:614
  DEBUG 2014-11-07 02:48:53.467631 [ 2 ] Clearing event for IO thread wakeup pipe 2 -> libgearman-server/gearmand_thread.cc:551
  DEBUG 2014-11-07 02:48:53.467635 [ 2 ] Exiting thread event loop -> libgearman-server/gearmand_thread.cc:471
  DEBUG 2014-11-07 02:48:53.467669 [ main ] Closing IO thread wakeup pipe -> libgearman-server/gearmand_thread.cc:539
  DEBUG 2014-11-07 02:48:53.467682 [ main ] Thread 2 shutdown complete -> libgearman-server/gearmand_thread.cc:369
  DEBUG 2014-11-07 02:48:53.467686 [ main ] Shutting down thread 1 -> libgearman-server/gearmand_thread.cc:284
  DEBUG 2014-11-07 02:48:53.467704 [ 1 ] Received SHUTDOWN wakeup event -> libgearman-server/gearmand_thread.cc:614
  DEBUG 2014-11-07 02:48:53.467711 [ 1 ] Clearing event for IO thread wakeup pipe 1 -> libgearman-server/gearmand_thread.cc:551
  DEBUG 2014-11-07 02:48:53.467715 [ 1 ] Exiting thread event loop -> libgearman-server/gearmand_thread.cc:471
  DEBUG 2014-11-07 02:48:53.467748 [ main ] Closing IO thread wakeup pipe -> libgearman-server/gearmand_thread.cc:539
  DEBUG 2014-11-07 02:48:53.467767 [ main ] Thread 1 shutdown complete -> libgearman-server/gearmand_thread.cc:369
  DEBUG 2014-11-07 02:48:53.467776 [ main ] removing queue: FUNCTION -> libgearman-server/gearmand.cc:178
   INFO 2014-11-07 02:48:53.467780 [ main ] Shutdown complete

Revision history for this message
linuxjcq (649903604-c) wrote :
Revision history for this message
chjgcn (chjgcn) wrote :

I have found that the server address was hardcoded as "127.0.0.1" in libgearman-server/plugins/queue/redis at line 120.

Revision history for this message
chjgcn (chjgcn) wrote :

In the redis queue, the server address was hardcoded as '127.0.0.1', and the method to get keys was useless, and the format of key made it difficult to get function name and unique from key.
This patch file fixes these bugs, adds support of authentication with redis server, and adds support of saving and retrieving priority and when_to_run of the jobs.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.