Closed kuchaguangjie closed 2 years ago
The first time it succeed, but the daemon is still running.
yes, the daemon will still be running.
drain will cause the controller to do the following:
Once the command returns / is complete the daemon can be safely stopped.
@willscott Thanks, as my understanding:
drain
, stop further task, and publish current tasks; but don't actually stop daemon, need to stop the daemon afterwards by hand.--id
of daemon is drained, the id can never be used again, since it's recorded in database, and no task will be assign to it. Unless that id is removed by hand from table drained_workers
?Not sure am I understanding correctly.
I've started a dealbot controller with
--listen :8764
, and started a dealbot daemon with--id 1
,Then call:
dealbot drain -e http://127.0.0.1:8764 --id 1
The first time it succeed, but the
daemon
is still running.So I called it again, and get error:
The controller also got error:
Then I check table
drained_workers
, via sql:and found the value
1
exists, I guess that causedduplicate key
.So, the questions are:
--id
of daemon when start?What does
drain
do? I saw it inserted 1 row (containing the id) into tabledrained_workers
, but the daemon process still running after that call.Thanks.