calling worker.stop() causes last WORK_COMPLETE packet not sent
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Gearman Java |
Confirmed
|
Medium
|
Eric Lambert |
Bug Description
In a worker runner if a shutdown request is fired like this (possibly in another thread) :
if(worker.
worker.stop();
}
a job is assigned and executed successfully, but the WORK_COMPLETE packet is not
sent, causing the same job assigned to another worker again.
logs from gearmand:
INFO Starting up
INFO Listening on :::4730 (6)
INFO Creating wakeup pipe
INFO Creating IO thread wakeup pipe
INFO Adding event for listening socket (6)
INFO Adding event for wakeup pipe
INFO Entering main event loop
INFO Accepted connection from ::804:191d:
INFO [ 0] ::804:191d:
INFO [ 0] ::804:191d:
INFO Accepted connection from ::804:191d:
INFO [ 0] ::804:191d:
INFO [ 0] ::804:191d:
INFO Accepted connection from ::804:191d:
INFO [ 0] ::804:191d:
INFO [ 0] ::804:191d:
INFO Received SHUTDOWN wakeup event
INFO Clearing event for listening socket (6)
INFO Clearing event for wakeup pipe
INFO [ 0] Received SHUTDOWN wakeup event
INFO [ 0] Clearing event for IO thread wakeup pipe
INFO Exited main event loop
INFO Closing listening socket (6)
INFO Closing wakeup pipe
INFO Closing IO thread wakeup pipe
INFO Shutdown complete
[root@webprt-lvs01 autorun]# gearmand -u gearmand -vvvvv
INFO Starting up
DEBUG Initializing libevent for main thread
DEBUG Method for libevent: epoll
DEBUG Trying to listen on :::4730
INFO Listening on :::4730 (6)
DEBUG Trying to listen on 0.0.0.0:4730
INFO Creating wakeup pipe
DEBUG Creating 0 threads
INFO Creating IO thread wakeup pipe
INFO Adding event for listening socket (6)
INFO Adding event for wakeup pipe
INFO Entering main event loop
INFO Accepted connection from ::4854:
CRAZY [ 0] ::4854:
INFO [ 0] ::4854:
CRAZY [ 0] ::4854:
DEBUG [ 0] ::4854:
CRAZY [ 0] ::4854:
DEBUG [ 0] ::4854:
CRAZY [ 0] ::4854:
INFO [ 0] ::4854:
INFO Accepted connection from ::4854:
CRAZY [ 0] ::4854:
INFO [ 0] ::4854:
CRAZY [ 0] ::4854:
DEBUG [ 0] ::4854:
CRAZY [ 0] ::4854:
CRAZY [ 0] ::4854:
DEBUG [ 0] ::4854:
CRAZY [ 0] ::4854:
DEBUG [ 0] ::4854:
CRAZY [ 0] ::4854:
DEBUG [ 0] ::4854:
CRAZY [ 0] ::4854:
CRAZY [ 0] ::4854:
DEBUG [ 0] ::4854:
CRAZY [ 0] ::4854:
DEBUG [ 0] ::4854:
CRAZY [ 0] ::4854:
DEBUG [ 0] ::4854:
CRAZY [ 0] ::4854:
DEBUG [ 0] ::4854:
CRAZY [ 0] ::4854:
INFO [ 0] ::4854:
possilbe fix:
=== modified file 'src/main/
--- src/main/
+++ src/main/
@@ -224,6 +224,7 @@
+ sess.driveSessi
} catch (IOException ioe) {
Changed in gearman-java: | |
importance: | Undecided → Medium |
milestone: | 0.05 → none |
Hi Darren:
Thanks for the bug report, but I dont I understand what the problem is you are seeing.
Is your situation like this:
1-Job is submitted to worker
2-Worker starts execution of job
3-Worker is stopped while Job is still running
If that is the case, then the correct behavior would be what you are seeing. We should only send a job_completed packet if the job has finished. Stopping the worker does not mean the jobs itself has finished.
Or is the situation you are seing like the following:
1-Job is submitted to worker
2-Worker starts execution of job
3-Job completes
4-Worker is stopped