# HG changeset patch # User drewp@bigasterisk.com # Date 2018-06-08 03:35:30 # Node ID 0bb7b9df12e5f982339ae073a2e53f5970e4203c # Parent 283ce478e60fffe88bfd6d4c486d8173562da77c collector warnings and errors. the reactor.crash isn't working. Ignore-this: b7d4a6c08f04c924ffba6112483f9c19 diff --git a/bin/collector b/bin/collector --- a/bin/collector +++ b/bin/collector @@ -146,8 +146,8 @@ def launch(graph, doLoadTest=False): Udmx(L9['output/dmxA/'], bus=4, numChannels=80), Udmx(L9['output/dmxB/'], bus=5, numChannels=510), ] - except Exception as e: - log.error("setting up outputs: %r", e) + except Exception: + log.error("setting up outputs:") traceback.print_exc() raise listeners = WebListeners() @@ -192,7 +192,7 @@ def main(): graph = SyncedGraph(networking.rdfdb.url, "collector") - graph.initiallySynced.addCallback(lambda _: launch(graph, options.loadtest)).addErrback(log.error) + graph.initiallySynced.addCallback(lambda _: launch(graph, options.loadtest)).addErrback(lambda e: reactor.crash()) reactor.run() if __name__ == '__main__': diff --git a/light9/collector/collector.py b/light9/collector/collector.py --- a/light9/collector/collector.py +++ b/light9/collector/collector.py @@ -103,7 +103,8 @@ class Collector(Generic[ClientType, Clie def _warnOnLateRequests(self, client, now, sendTime): requestLag = now - sendTime - if requestLag > .1 and now > self.initTime + 10: + if requestLag > .1 and now > self.initTime + 10 and getattr(self, '_lastWarnTime', 0) < now - 3: + self._lastWarnTime = now log.warn('collector.setAttrs from %s is running %.1fms after the request was made', client, requestLag * 1000)