Queue daemon fixes:
* skip unnecessary unsubscribes on graceful shutdown -- takes a long time for many queues, slows down our restarts when hitting graceful mem limit * fix control channel (was broken when we switched to support multiple queue servers)
This commit is contained in:
parent
e856af34c3
commit
d9c9b2a12f
|
@ -107,9 +107,10 @@ class StompQueueManager extends QueueManager
|
||||||
$message .= ':' . $param;
|
$message .= ':' . $param;
|
||||||
}
|
}
|
||||||
$this->_connect();
|
$this->_connect();
|
||||||
$result = $this->_send($this->control,
|
$con = $this->cons[$this->defaultIdx];
|
||||||
$message,
|
$result = $con->send($this->control,
|
||||||
array ('created' => common_sql_now()));
|
$message,
|
||||||
|
array ('created' => common_sql_now()));
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$this->_log(LOG_INFO, "Sent control ping to queue daemons: $message");
|
$this->_log(LOG_INFO, "Sent control ping to queue daemons: $message");
|
||||||
return true;
|
return true;
|
||||||
|
@ -368,17 +369,10 @@ class StompQueueManager extends QueueManager
|
||||||
foreach ($this->cons as $i => $con) {
|
foreach ($this->cons as $i => $con) {
|
||||||
if ($con) {
|
if ($con) {
|
||||||
$this->rollback($i);
|
$this->rollback($i);
|
||||||
$con->unsubscribe($this->control);
|
$con->disconnect();
|
||||||
|
$this->cons[$i] = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($this->sites) {
|
|
||||||
foreach ($this->sites as $server) {
|
|
||||||
StatusNet::init($server);
|
|
||||||
$this->doUnsubscribe();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$this->doUnsubscribe();
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user