summary refs log tree commit diff
path: root/synapse/push/httppusher.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Make starting pushers faster during start upErik Johnston2019-04-021-2/+10
| | | | | | | | | | | We start all pushers on start up and immediately start a background process to fetch push to send. This makes start up incredibly painful when dealing with many pushers. Instead, let's do a quick fast DB check to see if there *may* be push to send and only start the background processes for those pushers. We also stagger starting up and doing those checks so that we don't try and handle all pushers at once.
* Correctly handle null data in HttpPusherErik Johnston2019-02-221-0/+5
|
* Add prometheus metrics for number of badge update pushes. (#4709)Richard van der Hoff2019-02-221-8/+25
| | | | | | We're counting the number of push notifications, but not the number of badges; I'd like to see if they are significant.
* Logging improvements for the pusher (#4691)Richard van der Hoff2019-02-201-8/+8
|
* Clean up event accesses and testsErik Johnston2018-11-021-2/+2
| | | | | This is in preparation to refactor FrozenEvent to support different event formats for different room versions
* sanity-check the is_processing flagRichard van der Hoff2018-10-241-4/+7
| | | | ... and rename it, for even more sanity
* Make on_started synchronous tooRichard van der Hoff2018-10-221-1/+0
| | | | | | This brings it into line with on_new_notifications and on_new_receipts. It requires a little bit of hoop-jumping in EmailPusher to load the throttle params before the first loop.
* Remove redundant run_as_background_process() from pusherpoolRichard van der Hoff2018-10-221-2/+0
| | | | | | | `on_new_notifications` and `on_new_receipts` in `HttpPusher` and `EmailPusher` now always return synchronously, so we can remove the `defer.gatherResults` on their results, and the `run_as_background_process` wrappers can be removed too because the PusherPool methods will now complete quickly enough.
* Give pushers their own background logcontextRichard van der Hoff2018-10-221-34/+30
| | | | | | | | Each pusher has its own loop which runs for as long as it has work to do. This should run in its own background thread with its own logcontext, as other similar loops elsewhere in the system do - which means that CPU usage is consistently attributed to that loop, rather than to whatever request happened to start the loop.
* merge (#3576)Amber Brown2018-09-141-1/+6
|
* run isortAmber Brown2018-07-091-3/+3
|
* Remove all global reactor imports & pass it around explicitly (#3424)Amber Brown2018-06-251-2/+4
|
* fixesAmber Brown2018-05-221-2/+2
|
* replacing portionsAmber Brown2018-05-211-9/+4
|
* make imports localAdrian Tschira2018-04-281-2/+2
| | | | Signed-off-by: Adrian Tschira <nota@notafile.com>
* Improve exception handling for background processesRichard van der Hoff2018-04-271-1/+4
| | | | | | | | | | | | | | | | | | There were a bunch of places where we fire off a process to happen in the background, but don't have any exception handling on it - instead relying on the unhandled error being logged when the relevent deferred gets garbage-collected. This is unsatisfactory for a number of reasons: - logging on garbage collection is best-effort and may happen some time after the error, if at all - it can be hard to figure out where the error actually happened. - it is logged as a scary CRITICAL error which (a) I always forget to grep for and (b) it's not really CRITICAL if a background process we don't care about fails. So this is an attempt to add exception handling to everything we fire off into the background.
* Better logging when pushes failRichard van der Hoff2018-01-291-2/+8
|
* add appid/device_display_name to to pusher loggingRichard van der Hoff2018-01-291-2/+2
|
* Fix logging and add user_idRichard van der Hoff2018-01-221-2/+3
|
* logging and debug for http pusherRichard van der Hoff2018-01-221-4/+20
|
* Rename redact_content option to include_contentDavid Baker2017-11-081-1/+2
| | | | | | | | | | | | | | | | | | The redact_content option never worked because it read the wrong config section. The PR introducing it (https://github.com/matrix-org/synapse/pull/2301) had feedback suggesting the name be changed to not re-use the term 'redact' but this wasn't incorporated. This reanmes the option to give it a less confusing name, and also means that people who've set the redact_content option won't suddenly see a behaviour change when upgrading synapse, but instead can set include_content if they want to. This PR also updates the wording of the config comment to clarify that this has no effect on event_id_only push. Includes https://github.com/matrix-org/synapse/pull/2422
* replace 'except:' with 'except Exception:'Richard van der Hoff2017-10-231-3/+3
| | | | what could possibly go wrong
* Also include the room_idDavid Baker2017-09-181-0/+1
| | | | as really it's part of the event ID
* Use .get - it's much shorterDavid Baker2017-09-181-1/+1
|
* Add support for event_id_only push formatDavid Baker2017-09-181-0/+19
| | | | | | | Param in the data dict of a pusher that tells an HTTP pusher to send just the event_id of the event it's notifying about and the notification counts. For clients that want to go & fetch the body of the event themselves anyway.
* Fix TravisCI tests for PR #2301Caleb James DeLisle2017-06-231-1/+1
|
* Add configuration parameter to allow redaction of content from push messages ↵Caleb James DeLisle2017-06-231-1/+1
| | | | for google/apple devices
* Fix up push to use get_current_state_idsErik Johnston2016-08-251-1/+1
|
* Ignore AlreadyCalled errors on timer cancelErik Johnston2016-07-311-1/+6
|
* Create separate methods for getting messages to pushMark Haines2016-07-281-1/+2
| | | | | | | | | | | for the email and http pushers rather than trying to make a single method that will work with their conflicting requirements. The http pusher needs to get the messages in ascending stream order, and doesn't want to miss a message. The email pusher needs to get the messages in descending timestamp order, and doesn't mind if it misses messages.
* Use similar naming we use in email notifs for pushDavid Baker2016-06-241-3/+6
| | | | Fixes https://github.com/vector-im/vector-web/issues/1654
* Optionally split out the pushers into a separate processMark Haines2016-04-211-1/+1
|
* Add missing yieldErik Johnston2016-04-141-1/+1
|
* Rename log contextErik Johnston2016-04-141-1/+1
|
* Make send_badge privateErik Johnston2016-04-141-2/+2
|
* Add necessary logging contextsErik Johnston2016-04-141-24/+25
|
* Add extra MeasureErik Johnston2016-04-141-14/+16
|
* Run unsafe proces in a loop until we've caught upDavid Baker2016-04-111-4/+11
| | | | and wrap unsafe process in a try block
* Actually check if we;re processingDavid Baker2016-04-081-0/+2
|
* Make sure max stream ordering only increasesDavid Baker2016-04-081-1/+1
|
* Unsafe process should call itself if the max has changedDavid Baker2016-04-081-0/+3
|
* Comment why unsafe process is unsafeDavid Baker2016-04-081-0/+5
|
* Only pass in what we needDavid Baker2016-04-071-3/+5
|
* Wrap process in a flag so we don't process whist already processing.David Baker2016-04-071-0/+9
|
* Add measure blocksDavid Baker2016-04-071-5/+10
|
* Add comments on min_stream_idDavid Baker2016-04-071-0/+2
| | | | saying that the min stream id won't be completely accurate all the time
* Remove code that's now been obsoleted or moved elsewhereDavid Baker2016-04-071-1/+1
|
* Send badge count pushes.David Baker2016-04-071-16/+29
| | | | Also fix bugs with retrying.
* Make pushers use the event_push_actions table instead of listening on an ↵David Baker2016-04-061-38/+166
| | | | | | | event stream & running the rules again. Sytest passes, but remaining to do: * Make badges work again * Remove old, unused code
* Remove dead code for setting device specific rules.Mark Haines2016-02-181-2/+1
| | | | | | It wasn't possible to hit the code from the API because of a typo in parsing the request path. Since no-one was using the feature we might as well remove the dead code.
* Merge branch 'develop' into push_badge_countsDavid Baker2016-01-191-4/+4
|\
| * Rename 'user_name' to 'user_id' in push to make it consistent with the rest ↵Mark Haines2016-01-131-3/+3
| | | | | | | | of the code
* | Use the unread notification count to send accurate badge counts in push ↵David Baker2016-01-131-7/+7
|/ | | | notifications.
* copyrightsMatthew Hodgson2016-01-071-1/+1
|
* Reuse a single http client, rather than creating new onesMark Haines2015-12-021-4/+3
|
* Dial down logging for failed pushersDavid Baker2015-03-061-1/+1
|
* Add attribute so push gateways can tell if a member event is about the user ↵David Baker2015-03-061-0/+1
| | | | in question
* Send room ID in http notifications so clients know which room to go to if ↵David Baker2015-02-191-0/+1
| | | | the user responds to the notification.
* s/instance_handle/profile_tag/David Baker2015-02-031-2/+2
|
* Ignore empty strings for display names & room names in notificationsDavid Baker2015-01-311-2/+2
|
* Include content in notification pokesDavid Baker2015-01-291-0/+2
|
* Change 'from' in notification pokes to 'sender' to match client API v2. Send ↵David Baker2015-01-291-5/+4
| | | | sender display names where they exist.
* Code style fixes.Mark Haines2015-01-291-4/+4
|
* It is 2015David Baker2015-01-281-1/+1
|
* Reset badge count to zero when last active time is bumpedDavid Baker2015-01-281-3/+35
|
* Support membership events and more camelcase/underscoresDavid Baker2015-01-261-4/+4
|
* Use push settings!David Baker2015-01-231-4/+5
|
* use underscores everywhere, not camelcase.David Baker2015-01-201-3/+3
|
* add instance_handles to pushers so we have a way to refer to them even if ↵David Baker2015-01-201-1/+2
| | | | the push token changes.
* Send room name and first alias in notification poke.David Baker2015-01-151-3/+13
|
* Honour the 'rejected' return from push gatewaysDavid Baker2015-01-131-5/+10
| | | | | | | Add a timestamp to push tokens so we know the last time they we got them from the device. Send it to the push gateways so it can determine whether its failure is more recent than the token. Stop and remove pushers that have been rejected.
* after a few rethinks, a working implementation of pushers.David Baker2014-12-181-12/+13
|
* Update to app_id / app_instance_id (partially) and mangle to be PEP8 compliant.David Baker2014-12-031-33/+42
|
* More work on pushers. Attempt to do HTTP pokes. Not sure if the actual HTTP ↵David Baker2014-11-211-4/+51
| | | | pokes work or not yet but the retry semantics are pretty good.
* remove random half-lineDavid Baker2014-11-191-1/+0
|
* Start creating a module to do generic notifications (just prints them to ↵David Baker2014-11-191-0/+40
stdout currently!)