diff options
author | Erik Johnston <erikj@jki.re> | 2019-02-22 15:29:16 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-22 15:29:16 +0000 |
commit | d14e94bae49e3d2ec2ba5ea1ebd36e6b39b7dcc1 (patch) | |
tree | 2155320ecca321530b1ecd9793f31e355cf0211c | |
parent | Merge pull request #4715 from matrix-org/erikj/fix_state_invalidation (diff) | |
parent | Add missing return (diff) | |
download | synapse-d14e94bae49e3d2ec2ba5ea1ebd36e6b39b7dcc1.tar.xz |
Merge pull request #4716 from matrix-org/erikj/pusher_logging
Fix up pusher logging a bit
-rw-r--r-- | changelog.d/4716.misc | 1 | ||||
-rw-r--r-- | synapse/push/httppusher.py | 5 | ||||
-rw-r--r-- | synapse/push/pusher.py | 2 | ||||
-rw-r--r-- | synapse/push/pusherpool.py | 10 |
4 files changed, 17 insertions, 1 deletions
diff --git a/changelog.d/4716.misc b/changelog.d/4716.misc new file mode 100644 index 0000000000..5935f3af24 --- /dev/null +++ b/changelog.d/4716.misc @@ -0,0 +1 @@ +Reduce pusher logging on startup diff --git a/synapse/push/httppusher.py b/synapse/push/httppusher.py index 899a5253d8..e65f8c63d3 100644 --- a/synapse/push/httppusher.py +++ b/synapse/push/httppusher.py @@ -97,6 +97,11 @@ class HttpPusher(object): pusherdict['pushkey'], ) + if self.data is None: + raise PusherConfigException( + "data can not be null for HTTP pusher" + ) + if 'url' not in self.data: raise PusherConfigException( "'url' required in data for HTTP pusher" diff --git a/synapse/push/pusher.py b/synapse/push/pusher.py index 368d5094be..b33f2a357b 100644 --- a/synapse/push/pusher.py +++ b/synapse/push/pusher.py @@ -56,7 +56,7 @@ class PusherFactory(object): f = self.pusher_types.get(kind, None) if not f: return None - logger.info("creating %s pusher for %r", kind, pusherdict) + logger.debug("creating %s pusher for %r", kind, pusherdict) return f(self.hs, pusherdict) def _create_email_pusher(self, _hs, pusherdict): diff --git a/synapse/push/pusherpool.py b/synapse/push/pusherpool.py index b2c92ce683..abf1a1a9c1 100644 --- a/synapse/push/pusherpool.py +++ b/synapse/push/pusherpool.py @@ -19,6 +19,7 @@ import logging from twisted.internet import defer from synapse.metrics.background_process_metrics import run_as_background_process +from synapse.push import PusherConfigException from synapse.push.pusher import PusherFactory logger = logging.getLogger(__name__) @@ -222,6 +223,15 @@ class PusherPool: """ try: p = self.pusher_factory.create_pusher(pusherdict) + except PusherConfigException as e: + logger.warning( + "Pusher incorrectly configured user=%s, appid=%s, pushkey=%s: %s", + pusherdict.get('user_name'), + pusherdict.get('app_id'), + pusherdict.get('pushkey'), + e, + ) + return except Exception: logger.exception("Couldn't start a pusher: caught Exception") return |