From db8758cc3079e2fbd0d6622327a91420de1c36eb Mon Sep 17 00:00:00 2001 From: Marsell Kukuljevic Date: Sun, 11 Apr 2021 00:07:01 +0200 Subject: [PATCH] Attempt to fix 408 errors from the cueball connection pool. The pool now regularly pings cloudapi's /. Also (temporarily) silenced cueball noise. --- bin/server.js | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/bin/server.js b/bin/server.js index 1dbdd37..75bd31b 100755 --- a/bin/server.js +++ b/bin/server.js @@ -110,6 +110,20 @@ function login(req, res, cb) { } +// Logging function useful to silence bunyan-based logging systems +function silentLogger() { + let stub = function () {}; + + return { + child: silentLogger, + warn: stub, + trace: stub, + info: stub, + debug: stub + } +} + + // Start up HTTP server and pool of cloudapi clients. // // Read from config file, establish crypto singer needed for requests to @@ -132,8 +146,11 @@ function main() { CLOUDAPI = mod_restify.createStringClient({ url: CONFIG.urls.cloudapi, agent: new mod_cueball.HttpsAgent({ - spares: 0, - maximum: 4, + log: silentLogger(), // temporary + spares: 2, + maximum: 5, + ping: '/', + pingInterval: 5000, // in ms recovery: { default: { timeout: 2000,