Skip gatherng metrics from dropped slaves

Avoid stacking up huge amounts of metrics requests while a slave
connection is in the dropped state.
This commit is contained in:
Hornwitser committed 2021-09-28 21:36:28 +02:00
1 parent 3b6ebeb653
commit e5582b5558
1 file changed
+3
+3
View File
@@ -48,6 +48,9 @@ async function getMetrics(req, res, next) {
let requests = [];
let timeout = req.app.locals.master.config.get("master.metrics_timeout") * 1000;
for (let slaveConnection of req.app.locals.master.wsServer.slaveConnections.values()) {
if (!slaveConnection.connected) {
continue;
}
requests.push(libHelpers.timeout(
libLink.messages.getMetrics.send(slaveConnection).catch(err => {
if (!(err instanceof libErrors.SessionLost)) {