summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
* Fix typo in conditionalErik Johnston2018-07-251-1/+1
|
* NewsfileErik Johnston2018-07-251-0/+1
|
* Correctly handle outliers during persist eventsErik Johnston2018-07-251-6/+7
| | | | | | | | | | | | We incorrectly asserted that all contexts must have a non None state group without consider outliers. This would usually be fine as the assertion would never be hit, as there is a shortcut during persistence if the forward extremities don't change. However, if the outlier is being persisted with non-outlier events, the function would be called and the assertion would be hit. Fixes #3601
* Merge pull request #3597 from matrix-org/erikj/did_forgetErik Johnston2018-07-245-34/+38
|\ | | | | Fix client_reader worker being able to handle /context requests
| * Move newsfileErik Johnston2018-07-241-0/+0
| |
| * NewsfileErik Johnston2018-07-241-0/+1
| |
| * Replace usage of get_current_toke with StreamToken.STARTErik Johnston2018-07-242-5/+9
| | | | | | | | | | | | | | | | This allows us to handle /context/ requests on the client_reader worker without having to pull in all the various stream handlers (e.g. precence, typing, pushers etc). The only thing the token gets used for is pagination, and that ignores everything but the room portion of the token.
| * Pull out did_forget to worker storeErik Johnston2018-07-242-29/+28
|/
* Merge pull request #3595 from matrix-org/erikj/use_deltasErik Johnston2018-07-242-53/+119
|\ | | | | Use deltas to calculate current state deltas
| * Expand on docstring comment about return valueErik Johnston2018-07-241-0/+5
| |
| * Remove unnecessary iteritemsErik Johnston2018-07-241-1/+1
| |
| * Fixup comment (and indent)Erik Johnston2018-07-241-16/+20
| |
| * NewsfileErik Johnston2018-07-241-0/+1
| |
| * Don't fetch state from the database unless neededErik Johnston2018-07-241-12/+18
| |
| * Have _get_new_state_after_events return deltaErik Johnston2018-07-241-17/+48
| | | | | | | | | | | | If we have a delta from the existing to new current state, then we can reuse that rather than manually working it out by fetching both lots of state.
| * Don't require to_delete to have event_idsErik Johnston2018-07-241-36/+55
| |
* | Merge pull request #3587 from matrix-org/rav/better_exception_loggingRichard van der Hoff2018-07-242-3/+9
|\ \ | | | | | | Improve logging for exceptions when handling PDUs
| * | changelogRichard van der Hoff2018-07-231-0/+1
| | |
| * | Improve logging for exceptions handling PDUsRichard van der Hoff2018-07-231-3/+8
| | | | | | | | | | | | when we get an exception handling a federation PDU, log the whole stacktrace.
* | | Merge pull request #3586 from matrix-org/rav/optimise_resolve_state_groupsRichard van der Hoff2018-07-244-62/+98
|\ \ \ | | | | | | | | Fixes and optimisations for resolve_state_groups
| * | | Handle delta_ids being None in _update_context_for_auth_eventsRichard van der Hoff2018-07-232-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | it's easier to create the new state group as a delta from the existing one. (There's an outside chance this will help with https://github.com/matrix-org/synapse/issues/3364)
| * | | newsfileRichard van der Hoff2018-07-231-0/+1
| | | |
| * | | Fixes and optimisations for resolve_state_groupsRichard van der Hoff2018-07-231-54/+89
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First of all, fix the logic which looks for identical input state groups so that we actually use them. This turned out to be most easily done by factoring the relevant code out to a separate function so that we could do an early return. Secondly, avoid building the whole `conflicted_state` dict (which was only ever used as a boolean flag). Thirdly, replace the construction of the `state` dict (which mapped from keys to events that set them), with an optimistic construction of the resolution result assuming there will be no conflicts. This should be no slower than building the old `state` dict, and: - in the conflicted case, we'll short-cut it, saving part of the work - in the unconflicted case, it saves rebuilding the resolution from the `state` dict. Finally, do a couple of s/values/itervalues/.
* | | Merge pull request #3583 from matrix-org/rav/remove_who_forgot_in_roomRichard van der Hoff2018-07-244-46/+2
|\ \ \ | |_|/ |/| | Remove redundant checks on room forgottenness
| * | Merge remote-tracking branch 'origin/develop' into rav/remove_who_forgot_in_roomRichard van der Hoff2018-07-2419-317/+437
| |\ \
| * \ \ Merge remote-tracking branch 'origin/develop' into rav/remove_who_forgot_in_roomRichard van der Hoff2018-07-2330-196/+477
| |\ \ \
| * | | | Remove redundant checks on room forgottennessRichard van der Hoff2018-07-234-46/+2
| | | | | | | | | | | | | | | | | | | | Fixes #3550
* | | | | Merge pull request #3592 from matrix-org/erikj/speed_up_calculate_state_deltaErik Johnston2018-07-242-12/+5
|\ \ \ \ \ | |_|_|/ / |/| | | | Speed up _calculate_state_delta
| * | | | Merge branch 'develop' of github.com:matrix-org/synapse into ↵Erik Johnston2018-07-2417-315/+415
| |\ \ \ \ | |/ / / / |/| | | | | | | | | erikj/speed_up_calculate_state_delta
* | | | | Merge pull request #3591 from matrix-org/rav/logcontext_fixesRichard van der Hoff2018-07-245-21/+30
|\ \ \ \ \ | | | | | | | | | | | | Logcontext fixes
| * \ \ \ \ Merge branch 'develop' into rav/logcontext_fixesRichard van der Hoff2018-07-2413-295/+386
| |\ \ \ \ \ | |/ / / / / |/| | | | |
* | | | | | Merge pull request #3555 from matrix-org/erikj/client_apis_moveErik Johnston2018-07-2411-284/+364
|\ \ \ \ \ \ | | | | | | | | | | | | | | Make client_reader support some more read only APIs
| * \ \ \ \ \ Merge branch 'develop' into erikj/client_apis_moveErik Johnston2018-07-2419-141/+349
| |\ \ \ \ \ \ | | | |_|_|_|/ | | |/| | | |
| * | | | | | Merge branch 'develop' of github.com:matrix-org/synapse into ↵Erik Johnston2018-07-2381-3298/+3718
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | erikj/client_apis_move
| * | | | | | | Update docs/workers.rstErik Johnston2018-07-231-0/+4
| | | | | | | |
| * | | | | | | Move PaginationHandler to its own fileErik Johnston2018-07-203-245/+269
| | | | | | | |
| * | | | | | | Move check_in_room_or_world_readable to AuthErik Johnston2018-07-202-34/+40
| | | | | | | |
| * | | | | | | NewsfileErik Johnston2018-07-181-0/+1
| | | | | | | |
| * | | | | | | Add some room read only APIs to client_readerErik Johnston2018-07-181-1/+13
| | | | | | | |
| * | | | | | | Move RoomContextHandler out of HandlersErik Johnston2018-07-184-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is in preparation for moving GET /context/ to a worker
| * | | | | | | Split MessageHandler into read only and writersErik Johnston2018-07-185-149/+176
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will let us call the read only parts from workers, and so be able to move some APIs off of master, e.g. the `/state` API.
* | | | | | | | Merge pull request #3590 from matrix-org/rav/persist_events_metricsRichard van der Hoff2018-07-242-11/+22
|\ \ \ \ \ \ \ \ | |_|_|/ / / / / |/| | | | | | | Add some measure blocks to persist_events
| * | | | | | | changelogRichard van der Hoff2018-07-241-0/+1
| | | | | | | |
| * | | | | | | fix idiocyRichard van der Hoff2018-07-241-2/+8
| | | | | | | |
| * | | | | | | Add some measure blocks to persist_eventsRichard van der Hoff2018-07-231-11/+15
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | ... to help us figure out where 40% of CPU is going
| | | * | | | another couple of logcontext leaksRichard van der Hoff2018-07-242-5/+10
| | | | | | |
| | | * | | | ChangelogRichard van der Hoff2018-07-241-0/+1
| | | | | | |
| | | * | | | Logcontext fixesRichard van der Hoff2018-07-243-16/+19
| |_|/ / / / |/| | | | | | | | | | | | | | | | | Fix some random logcontext leaks.
| | | * | | Remove unnecessary ifErik Johnston2018-07-241-2/+1
| | | | | |
| | | * | | NewsfileErik Johnston2018-07-241-0/+1
| | | | | |
| | | * | | Speed up _calculate_state_deltaErik Johnston2018-07-241-10/+3
| |_|/ / / |/| | | |
* | | | | Merge pull request #3584 from matrix-org/erikj/use_cachedErik Johnston2018-07-233-1/+21
|\ \ \ \ \ | |_|_|_|/ |/| | | | Only get cached state from context in persist_event
| * | | | CommentsErik Johnston2018-07-232-2/+6
| | | | |
| * | | | NewsfileErik Johnston2018-07-231-0/+1
| | | | |
| * | | | Only get cached state from context in persist_eventErik Johnston2018-07-232-1/+16
|/ / / / | | | | | | | | | | | | | | | | | | | | We don't want to bother pulling out the current state from the DB since until we know we have to. Checking the context for state is just an optimisation.
* | | | Merge pull request #3582 from matrix-org/erikj/fixup_statelessErik Johnston2018-07-234-8/+15
|\ \ \ \ | | | | | | | | | | Fix missing attributes on workers.
| * | | | NewsfileErik Johnston2018-07-231-0/+1
| | | | |
| * | | | Fix missing attributes on workers.Erik Johnston2018-07-233-8/+14
|/ / / / | | | | | | | | | | | | | | | | This was missed during the transition from attribute to getter for getting state from context.
* | | | Merge pull request #3581 from matrix-org/erikj/fixup_statelessErik Johnston2018-07-232-7/+8
|\ \ \ \ | | | | | | | | | | Fix EventContext when using workers
| * | | | NewsfileErik Johnston2018-07-231-0/+1
| | | | |
| * | | | Fix EventContext when using workersErik Johnston2018-07-231-7/+7
|/ / / / | | | | | | | | | | | | | | | | | | | | We were: 1. Not correctly setting all attributes 2. Using defer.inlineCallbacks in a non-generator
* | | | Merge pull request #3579 from matrix-org/erikj/stateless_contexts_4Erik Johnston2018-07-2314-99/+260
|\ \ \ \ | | | | | | | | | | Add concept of StatelessContext, take 4.
| * | | | Update docstrings to make senseErik Johnston2018-07-231-5/+8
| | | | |
| * | | | Merge branch 'develop' into erikj/stateless_contexts_4Richard van der Hoff2018-07-230-0/+0
| |\ \ \ \ | |/ / / / |/| | | |
* | | | | Merge pull request #3577 from matrix-org/erikj/cleanup_contextErik Johnston2018-07-233-63/+82
|\ \ \ \ \ | |_|_|/ / |/| | | | Refcator EventContext to accept state during init
| | * | | Fix unit testsErik Johnston2018-07-232-15/+40
| | | | |
| | * | | NewsfileErik Johnston2018-07-231-0/+1
| | | | |
| | * | | Add support for updating stateErik Johnston2018-07-232-9/+42
| | | | |
| | * | | Use new gettersErik Johnston2018-07-239-31/+59
| | | | |
| | * | | Make EventContext lazy load stateErik Johnston2018-07-232-44/+115
| |/ / /
| * | | pep8Erik Johnston2018-07-231-1/+1
| | | |
| * | | NewsfileErik Johnston2018-07-231-0/+0
| | | |
| * | | Refcator EventContext to accept state during initErik Johnston2018-07-232-63/+82
|/ / /
* | | Merge pull request #3520 from matrix-org/matthew/sync_deleted_devicesMatthew Hodgson2018-07-234-22/+61
|\ \ \ | | | | | | | | Announce deleted devices explicitly over federation.
| * \ \ Merge branch 'develop' into matthew/sync_deleted_devicesMatthew Hodgson2018-07-23103-4671/+5379
| |\ \ \ | |/ / / |/| | |
* | | | Make the rest of the .iterwhatever go away (#3562)Amber Brown2018-07-218-27/+33
| | | |
* | | | Merge pull request #3572 from matrix-org/rav/linearizer_cancellationRichard van der Hoff2018-07-203-6/+54
|\ \ \ \ | |_|_|/ |/| | | Test and fix support for cancellation in Linearizer
| * | | ChangelogRichard van der Hoff2018-07-201-0/+1
| | | |
| * | | Test and fix support for cancellation in LinearizerRichard van der Hoff2018-07-202-6/+53
|/ / /
* | | Merge pull request #3571 from matrix-org/rav/limiter_fixesRichard van der Hoff2018-07-206-164/+88
|\ \ \ | | | | | | | | A set of improvements to the Limiter
| * | | changelogsRichard van der Hoff2018-07-202-0/+2
| | | |
| * | | Combine Limiter and LinearizerRichard van der Hoff2018-07-204-161/+59
| | | | | | | | | | | | | | | | | | | | Linearizer was effectively a Limiter with max_count=1, so rather than maintaining two sets of code, let's combine them.
| * | | Improvements to the LimiterRichard van der Hoff2018-07-202-14/+21
| | | | | | | | | | | | | | | | | | | | * give them names, to improve logging * use a deque rather than a list for efficiency
| * | | Add a sleep to the Limiter to fix stack overflows.Richard van der Hoff2018-07-202-7/+24
| | | | | | | | | | | | | | | | Fixes #3570
* | | | Admin API for creating new users (#3415)Amber Brown2018-07-208-3/+569
|/ / /
* | | Merge pull request #3564 from matrix-org/hawkowl/markdownRichard van der Hoff2018-07-195-2879/+2499
|\ \ \ | | | | | | | | Switch changes to markdown & flip content on for miscs
| * \ \ Merge remote-tracking branch 'origin/develop' into hawkowl/markdownAmber Brown2018-07-191-7/+16
| |\ \ \ | |/ / / |/| | |
* | | | Merge branch 'master' into developRichard van der Hoff2018-07-191-7/+17
|\ \ \ \
| * | | | Update r0.33.0 release notes github/release-v0.33.0 release-v0.33.0Richard van der Hoff2018-07-191-7/+17
| | | | | | | | | | | | | | | | | | | | (mostly just clarifications)
| | * | | fixesAmber Brown2018-07-192-1/+2
| | | | |
| | * | | fix up weird translation thingsAmber Brown2018-07-191-806/+813
| | | | |
| | * | | changelogAmber Brown2018-07-191-0/+1
| | | | |
| | * | | make pyproject point at itAmber Brown2018-07-191-2/+27
| | | | |
| | * | | rst -> mdAmber Brown2018-07-192-2867/+2454
| |/ / / |/| | |
* | | | Merge branch 'master' into developAmber Brown2018-07-193-8/+8
|\| | |
| * | | 0.33.0 final changelog v0.33.0Amber Brown2018-07-1921-13/+28
| | | |
| * | | 0.33 finalAmber Brown2018-07-191-1/+1
| | | |
| * | | update changelogsAmber Brown2018-07-196-2/+4
| | | |
| * | | Revert "0.33.0rc1 changelog"Amber Brown2018-07-1920-27/+10
| | | | | | | | | | | | | | | | This reverts commit 21d3b879433e040babd43c89b62827f92e3ac861.
* | | | Don't spew errors because we can't save metrics (#3563)Amber Brown2018-07-193-6/+25
| | | |
* | | | Merge pull request #3507 from Peetz0r/patch-1Richard van der Hoff2018-07-191-8/+8
|\ \ \ \ | | | | | | | | | | Changed http links to https
| * | | | change http links to httpsPeter2018-07-101-8/+8
| | | | | | | | | | | | | | | Especially useful for the debian repo, as this makes it easier to get the key in a secure way
* | | | | revert 00bc979Richard van der Hoff2018-07-191-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | ... we've fixed the things that caused the warnings, so we should reinstate the warning.
* | | | | Merge remote-tracking branch 'origin/release-v0.33.0' into developRichard van der Hoff2018-07-1923-14/+33
|\ \ \ \ \ | | |/ / / | |/| | |
| * | | | Merge pull request #3561 from matrix-org/rav/disable_logcontext_warningRichard van der Hoff2018-07-192-3/+5
| |\ \ \ \ | | | | | | | | | | | | Disable logcontext warning
| | * | | | changelogRichard van der Hoff2018-07-191-0/+1
| | | | | |
| | * | | | Disable logcontext warningRichard van der Hoff2018-07-191-3/+4
| |/ / / / | | | | | | | | | | | | | | | Temporary workaround to #3518 while we release 0.33.0.
| * | | | 0.33.0rc1 changelog v0.33.0rc1Amber Brown2018-07-1820-10/+27
| | | | |
| * | | | bump to 0.33.0rc1Amber Brown2018-07-181-1/+1
| | | | |
* | | | | Merge pull request #3556 from matrix-org/rav/background_processesRichard van der Hoff2018-07-199-104/+67
|\ \ \ \ \ | | | | | | | | | | | | Run things as background processes
| * | | | | Make Distributor run its processes as a background processRichard van der Hoff2018-07-182-78/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is more involved than it might otherwise be, because the current implementation just drops its logcontexts and runs everything in the sentinel context. It turns out that we aren't actually using a bunch of the functionality here (notably suppress_failures and the fact that Distributor.fire returns a deferred), so the easiest way to fix this is actually by simplifying a bunch of code.
| * | | | | changelogRichard van der Hoff2018-07-181-0/+1
| | | | | |
| * | | | | Run things as background processesRichard van der Hoff2018-07-187-26/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes #3518, and ensures that we get useful logs and metrics for lots of things that happen in the background. (There are certainly more things that happen in the background; these are just the common ones I've found running a single-process synapse locally).
* | | | | | Move v1-only APIs into their own module & isolate deprecated ones (#3460)Amber Brown2018-07-1913-101/+116
| | | | | |
* | | | | | Merge pull request #3554 from matrix-org/erikj/response_metrics_codeErik Johnston2018-07-192-3/+7
|\ \ \ \ \ \ | | | | | | | | | | | | | | Add response code to response timer metrics
| * | | | | | pep8Erik Johnston2018-07-181-1/+2
| | | | | | |
| * | | | | | NewsfileErik Johnston2018-07-181-0/+1
| | | | | | |
| * | | | | | Add response code to response timer metricsErik Johnston2018-07-181-3/+5
| | |_|_|_|/ | |/| | | |
* | | | | | Merge pull request #3559 from matrix-org/rav/pep8_configAmber Brown2018-07-192-3/+9
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | add config for pep8
| * | | | | changelogRichard van der Hoff2018-07-181-0/+1
| | | | | |
| * | | | | add config for pep8Richard van der Hoff2018-07-181-3/+8
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since, for better or worse, we seem to have configured isort to generate 89-character lines, pycharm is now complaining at me that our lines are too long. So, let's configure pep8 to behave consistently with flake8.
* | | | | Merge pull request #3553 from matrix-org/rav/background_process_trackingRichard van der Hoff2018-07-183-5/+187
|\ \ \ \ \ | |/ / / / |/| | | | Resource tracking for background processes
| * | | | changelogRichard van der Hoff2018-07-181-0/+1
| | | | |
| * | | | Resource tracking for background processesRichard van der Hoff2018-07-182-5/+186
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces a mechanism for tracking resource usage by background processes, along with an example of how it will be used. This will help address #3518, but more importantly will give us better insights into things which are happening but not being shown up by the request metrics. We *could* do this with Measure blocks, but: - I think having them pulled out as a completely separate metric class will make it easier to distinguish top-level processes from those which are nested. - I want to be able to report on in-flight background processes, and I don't think we want to do this for *all* Measure blocks.
* | | | Merge pull request #3367 from matrix-org/rav/drop_re_signing_hacksRichard van der Hoff2018-07-182-43/+1
|\ \ \ \ | | | | | | | | | | Remove event re-signing hacks
| * | | | Add changelogRichard van der Hoff2018-07-041-0/+1
| | | | |
| * | | | Merge branch 'develop' into rav/drop_re_signing_hacksRichard van der Hoff2018-07-04152-642/+2188
| |\ \ \ \
| * | | | | Remove event re-signing hacksRichard van der Hoff2018-06-071-43/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These "temporary fixes" have been here three and a half years, and I can't find any events in the matrix.org database where the calculated signature differs from what's in the db. It's time for them to go away.
* | | | | | Merge pull request #3514 from matrix-org/dbkr/turn_dont_add_defaultsDavid Baker2018-07-182-2/+3
|\ \ \ \ \ \ | |_|_|/ / / |/| | | | | Comment dummy TURN parameters in default config
| * | | | | I failed to correctly guess the PR numberDavid Baker2018-07-111-0/+0
| | | | | |
| * | | | | Comment dummy TURN parameters in default configDavid Baker2018-07-112-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This default config is parsed and used a base before the actual config is overlaid, so with these values not commented out, the code to detect when no turn params were set and refuse to generate credentials was never firing because the dummy default was always set.
* | | | | | Merge pull request #3546 from matrix-org/rav/fix_erasure_over_federationRichard van der Hoff2018-07-173-56/+133
|\ \ \ \ \ \ | | | | | | | | | | | | | | Fix visibility of events from erased users over federation
| * | | | | | add a commentRichard van der Hoff2018-07-171-0/+2
| | | | | | |
| * | | | | | changelogRichard van der Hoff2018-07-171-0/+1
| | | | | | |
| * | | | | | Fix visibility of events from erased users over federationRichard van der Hoff2018-07-172-56/+130
|/ / / / / /
* | | | | | Merge pull request #3541 from matrix-org/rav/optimize_filter_events_for_serverRichard van der Hoff2018-07-174-138/+409
|\ \ \ \ \ \ | | | | | | | | | | | | | | Refactor and optimze filter_events_for_server
| * | | | | | fix importsRichard van der Hoff2018-07-172-0/+2
| | | | | | |
| * | | | | | add a commentRichard van der Hoff2018-07-171-0/+2
| | | | | | |
| * | | | | | ChangelogRichard van der Hoff2018-07-161-0/+1
| | | | | | |
| * | | | | | Attempt to make _filter_events_for_server more efficientRichard van der Hoff2018-07-161-17/+23
| | | | | | |
| * | | | | | Add a test which profiles filter_events_for_server in a large roomRichard van der Hoff2018-07-161-2/+155
| | | | | | |
| * | | | | | Move filter_events_for_server out of FederationHandlerRichard van der Hoff2018-07-163-138/+245
| | | | | | | | | | | | | | | | | | | | | | | | | | | | for easier unit testing.
* | | | | | | Refactor REST API tests to use explicit reactors (#3351)Amber Brown2018-07-1713-934/+939
| | | | | | |
* | | | | | | Merge pull request #3544 from matrix-org/erikj/fixup_stream_cacheErik Johnston2018-07-173-1/+19
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Fix perf regression in PR #3530
| * | | | | | | Use efficient .intersectionErik Johnston2018-07-171-4/+1
| | | | | | | |
| * | | | | | | Add unit testErik Johnston2018-07-171-0/+16
| | | | | | | |
| * | | | | | | NewsfileErik Johnston2018-07-171-0/+0
| | | | | | | |
| * | | | | | | Fix perf regression in PR #3530Erik Johnston2018-07-171-1/+6
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The get_entities_changed function was changed to return all changed entities since the given stream position, rather than only those changed from a given list of entities. This resulted in the function incorrectly returning large numbers of entities that, for example, caused large increases in database usage.
* | | | | | | Merge pull request #3530 from matrix-org/erikj/stream_cacheAmber Brown2018-07-173-11/+4
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Don't return unknown entities in get_entities_changed
| * | | | | | | Fixup unit testErik Johnston2018-07-131-3/+3
| | | | | | | |
| * | | | | | | NewsfileErik Johnston2018-07-131-0/+0
| | | | | | | |
| * | | | | | | Don't return unknown entities in get_entities_changedErik Johnston2018-07-131-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The stream cache keeps track of all entities that have changed since a particular stream position, so get_entities_changed does not need to return unknown entites when given a larger stream position. This makes it consistent with the behaviour of has_entity_changed.
* | | | | | | | Merge pull request #3540 from krombel/enforce_isortAmber Brown2018-07-178-9/+17
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | check isort by travis
| * | | | | | | | rename 'isort' to 'check_isort' as requestedKrombel2018-07-162-3/+3
| | | | | | | | |
| * | | | | | | | rerun isort with latest versionKrombel2018-07-166-20/+4
| | | | | | | | |
| * | | | | | | | check isort by travisKrombel2018-07-1614-13/+37
|/ / / / / / / /
* | | | | | | | Fix develop because I broke it :( (#3535)Amber Brown2018-07-143-2/+5
| | | | | | | |
* | | | | | | | Merge pull request #3534 from krombel/use_parse_and_asserts_from_servletAmber Brown2018-07-1418-165/+102
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Use parse and asserts from http.servlet
| * | | | | | | | fix sytestsAmber Brown2018-07-141-1/+1
| | | | | | | | |
| * | | | | | | | add changelogKrombel2018-07-132-1/+2
| | | | | | | | |
| * | | | | | | | rename assert_params_in_request to assert_params_in_dictKrombel2018-07-1311-33/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the method "assert_params_in_request" does handle dicts and not requests. A request body has to be parsed to json before this method can be used
| * | | | | | | | Use parse_{int,str} and assert from http.servletKrombel2018-07-1314-155/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | parse_integer and parse_string can take a request and raise errors in case we have wrong or missing params. This PR tries to use them more to deduplicate some code and make it better readable
* | | | | | | | | Make auth & transactions more testable (#3499)Amber Brown2018-07-1410-98/+97
|/ / / / / / / /
* | | | | | | | Merge pull request #3533 from matrix-org/rav/fix_federation_ratelimite_queueRichard van der Hoff2018-07-133-10/+25
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | | Make FederationRateLimiter queue requests properly
| * | | | | | | better changelogRichard van der Hoff2018-07-131-1/+1
| | | | | | | |
| * | | | | | | changelogRichard van der Hoff2018-07-131-0/+1
| | | | | | | |
| * | | | | | | Fix unit testsRichard van der Hoff2018-07-131-0/+1
| | | | | | | |
| * | | | | | | Make FederationRateLimiter queue requests properlyRichard van der Hoff2018-07-131-10/+23
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | popitem removes the *most recent* item by default [1]. We want the oldest. Fixes #3524 [1]: https://docs.python.org/2/library/collections.html#collections.OrderedDict.popitem
* / / / / / / typoMatthew Hodgson2018-07-131-3/+3
|/ / / / / /
* | | | | | Merge pull request #3521 from matrix-org/rav/optimise_stream_change_cacheRichard van der Hoff2018-07-122-8/+13
|\ \ \ \ \ \ | | | | | | | | | | | | | | Reduce set building in get_entities_changed
| * | | | | | changelogRichard van der Hoff2018-07-121-0/+1
| | | | | | |
| * | | | | | Reduce set building in get_entities_changedRichard van der Hoff2018-07-121-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This line shows up as about 5% of cpu time on a synchrotron: not_known_entities = set(entities) - set(self._entity_to_key) Presumably the problem here is that _entity_to_key can be largeish, and building a set for its keys every time this function is called is slow. Here we rewrite the logic to avoid building so many sets.
* | | | | | | Merge pull request #3316 from matrix-org/rav/enforce_report_apiRichard van der Hoff2018-07-122-2/+25
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | Enforce the specified API for report_event
| * | | | | | changelogRichard van der Hoff2018-07-121-0/+1
| | | | | | |
| * | | | | | Merge branch 'develop' into rav/enforce_report_apiRichard van der Hoff2018-07-12370-2555/+5185
| |\ \ \ \ \ \ | |/ / / / / / |/| | | | | |
* | | | | | | Merge pull request #3505 from matrix-org/erikj/receipts_cahceErik Johnston2018-07-123-7/+21
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | | | Use stream cache in get_linearized_receipts_for_room
| * | | | | | Update return value docstringErik Johnston2018-07-121-1/+1
| | | | | | |
| * | | | | | Use 'is not None' and add commentsErik Johnston2018-07-101-2/+6
| | | | | | |
| * | | | | | NewsfileErik Johnston2018-07-101-0/+1
| | | | | | |
| * | | | | | Use stream cache in get_linearized_receipts_for_roomErik Johnston2018-07-102-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This avoids us from uncessarily hitting the database when there has been no change for the room
| | * | | | | Enforce the specified API for report_eventRichard van der Hoff2018-05-311-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | as per https://matrix.org/docs/spec/client_server/unstable.html#post-matrix-client-r0-rooms-roomid-report-eventid
| | | | | | * add trailing commaMatthew Hodgson2018-07-231-1/+1
| | | | | | |
| | | | | | * yes, we do need to invalidate the device_id_exists_cache when deleting a ↵Matthew Hodgson2018-07-191-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | remote device
| | | | | | * spell out that include_deleted_devices requires include_all_devicesMatthew Hodgson2018-07-191-1/+5
| | | | | | |
| | | | | | * changelogMatthew Hodgson2018-07-121-0/+1
| | | | | | |
| | | | | | * shift to using an explicit deleted flag on m.device_list_update EDUsMatthew Hodgson2018-07-122-20/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | and generally make it work.
| | | | | | * WIP to announce deleted devices over federationMatthew Hodgson2018-07-123-14/+44
| |_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we queued up the poke correctly when the device was deleted, but then the actual EDU wouldn't get sent, as the device was no longer known. Instead, we now send EDUs for deleted devices too if there's a poke for them.
* | | | | | Merge pull request #3498 from OlegGirko/fix_attrs_syntaxAmber Brown2018-07-112-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Use more portable syntax using attrs package. Newer syntax attr.ib(factory=dict) is just a syntactic sugar for attr.ib(default=attr.Factory(dict)) It was introduced in newest version of attrs package (18.1.0) and doesn't work with older versions. We should either require minimum version of attrs to be 18.1.0, or use older (slightly more verbose) syntax. Requiring newest version is not a good solution because Linux distributions may have older version of attrs (17.4.0 in Fedora 28), and requiring to build (and package) newer version just to use newer syntactic sugar in only one test is just too much. It's much better to fix that test to use older syntax. Signed-off-by: Oleg Girko <ol@infoserver.lv>
| * | | | | | changelog entryAmber Brown2018-07-111-0/+0
| | | | | | |
| * | | | | | Use more portable syntax using attrs package.Oleg Girko2018-07-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Newer syntax attr.ib(factory=dict) is just a syntactic sugar for attr.ib(default=attr.Factory(dict)) It was introduced in newest version of attrs package (18.1.0) and doesn't work with older versions. We should either require minimum version of attrs to be 18.1.0, or use older (slightly more verbose) syntax. Requiring newest version is not a good solution because Linux distributions may have older version of attrs (17.4.0 in Fedora 28), and requiring to build (and package) newer version just to use newer syntactic sugar in only one test is just too much. It's much better to fix that test to use older syntax. Signed-off-by: Oleg Girko <ol@infoserver.lv>
* | | | | | | s/becuase/because/gMatthew Hodgson2018-07-103-4/+4
| |/ / / / / |/| | | | |
* | | | | | Attempt to include db threads in cpu usage stats (#3496)Richard van der Hoff2018-07-104-20/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let's try to include time spent in the DB threads in the per-request/block cpu usage metrics.
* | | | | | Refactor logcontext resource usage tracking (#3501)Richard van der Hoff2018-07-105-130/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Factor out the resource usage tracking out to a separate object, which can be passed around and copied independently of the logcontext itself.
* | | | | | another typoMatthew Hodgson2018-07-101-1/+1
| | | | | |
* | | | | | typo (i think)Matthew Hodgson2018-07-101-1/+1
| | | | | |
* | | | | | Merge pull request #3497 from matrix-org/rav/measure_fetch_event_loopRichard van der Hoff2018-07-102-19/+33
|\ \ \ \ \ \ | |/ / / / / |/| | | | | Add CPU metrics for _fetch_event_list
| * | | | | changelogRichard van der Hoff2018-07-091-0/+1
| | | | | |
| * | | | | Add CPU metrics for _fetch_event_listRichard van der Hoff2018-07-091-19/+32
|/ / / / / | | | | | | | | | | | | | | | | | | | | add a Measure block on _fetch_event_list, in the hope that we can better measure CPU usage here.
* | | | | Merge pull request #3464 from matrix-org/hawkowl/isort-runRichard van der Hoff2018-07-09335-1528/+1609
|\ \ \ \ \ | | | | | | | | | | | | Run isort on Synapse
| * | | | | changelogAmber Brown2018-07-091-0/+0
| | | | | |
| * | | | | run isortAmber Brown2018-07-09334-1528/+1609
|/ / / / /
* | | | / Add an isort configuration (#3463)Amber Brown2018-07-092-0/+12
| |_|_|/ |/| | |
* | | | changelog v0.32.2 github/release-v0.32.2 release-v0.32.2Amber Brown2018-07-072-1/+9
| | | |
* | | | versionAmber Brown2018-07-071-1/+1
| | | |
* | | | Correct attrs package name in requirements (#3492)Amber Brown2018-07-073-1/+3
| | | |
* | | | Merge tag 'v0.32.1'Richard van der Hoff2018-07-063-4/+11
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Synapse 0.32.1 (2018-07-06) =========================== Bugfixes -------- - Add explicit dependency on netaddr ([#3488](https://github.com/matrix-org/synapse/issues/3488))
| * | | | Prepare 0.32.1 release v0.32.1 github/release-v0.32.1 release-v0.32.1Richard van der Hoff2018-07-063-2/+10
| | | | |
| * | | | Merge pull request #3488 from matrix-org/rav/fix-netaddr-depRichard van der Hoff2018-07-062-3/+2
|/| | | | | | | | | | | | | | Add explicit dependency on netaddr
| * | | | Add explicit dependency on netaddrRichard van der Hoff2018-07-062-3/+2
|/ / / / | | | | | | | | | | | | | | | | the dependencies file, causing failures on upgrade (and presumably for new installs).
* | | | 0.32.0 version bump, update changelog v0.32.0 github/release-v0.32.0 release-v0.32.0Neil Johnson2018-07-062-1/+5
| | | |
* | | | changelog v0.32.0rc1Amber Brown2018-07-0529-19/+47
| | | |
* | | | ACL changelogAmber Brown2018-07-051-0/+1
| | | |
* | | | bump version to 0.32.0rc1Amber Brown2018-07-051-1/+1
| | | |
* | | | Merge remote-tracking branch 'hera/rav/server_acls' into developNeil Johnson2018-07-055-4/+213
|\ \ \ \
| * | | | Implementation of server_aclsRichard van der Hoff2018-07-045-4/+213
| | | | | | | | | | | | | | | | | | | | | | | | | ... as described at https://docs.google.com/document/d/1EttUVzjc2DWe2ciw4XPtNpUpIl9lWXGEsy2ewDS7rtw.
* | | | | Merge pull request #3483 from matrix-org/rav/more_server_name_validationErik Johnston2018-07-055-13/+68
|\| | | | | | | | | | | | | | More server_name validation
| * | | | More server_name validationRichard van der Hoff2018-07-045-13/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to do a bit more validation when we get a server name, but don't want to be re-doing it all over the shop, so factor out a separate parse_and_validate_server_name, and do the extra validation. Also, use it to verify the server name in the config file.
* | | | | Merge pull request #3481 from matrix-org/rav/fix_cachedescriptor_testRichard van der Hoff2018-07-042-2/+16
|\ \ \ \ \ | |/ / / / |/| | | | Reinstate lost run_on_reactor in unit test
| * | | | Reinstate lost run_on_reactor in unit testRichard van der Hoff2018-07-042-2/+16
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | a61738b removed a call to run_on_reactor from a unit test, but that call was doing something useful, in making the function in question asynchronous. Reinstate the call and add a check that we are testing what we wanted to be testing.
* | | | Merge pull request #3473 from matrix-org/erikj/thread_cacheErik Johnston2018-07-042-1/+3
|\ \ \ \ | | | | | | | | | | Invalidate cache on correct thread
| * | | | Correct newsfileErik Johnston2018-07-022-0/+1
| | | | |
| * | | | NewsfileErik Johnston2018-07-021-0/+0
| | | | |
| * | | | Invalidate cache on correct threadErik Johnston2018-07-021-1/+2
| | | | |
* | | | | Merge pull request #3474 from matrix-org/erikj/py3_authErik Johnston2018-07-042-1/+6
|\ \ \ \ \ | |_|/ / / |/| | | | Fix up auth check
| * | | | NewsfileErik Johnston2018-07-021-0/+0
| | | | |
| * | | | Avoid relying on int vs None comparisonErik Johnston2018-07-021-1/+5
| | | | | | | | | | | | | | | | | | | | Python 3 doesn't support comparing None to ints
| * | | | Ensure that we define sender_domainErik Johnston2018-07-021-0/+1
| |/ / /
* | | | Reject invalid server names (#3480)Richard van der Hoff2018-07-035-25/+122
| | | | | | | | | | | | | | | | | | | | Make sure that server_names used in auth headers are sane, and reject them with a sensible error code, before they disappear off into the depths of the system.
* | | | Merge pull request #3470 from matrix-org/matthew/fix-utf8-loggingRichard van der Hoff2018-07-022-2/+18
|\ \ \ \ | |/ / / |/| | | don't mix unicode strings with utf8-in-byte-strings
| * | | news snippetMatthew Hodgson2018-07-021-0/+1
| | | |
| * | | replace invalid utf8 with \ufffdMatthew Hodgson2018-07-021-2/+2
| | | |
| * | | a fix which doesn't NPE everywhereMatthew Hodgson2018-07-011-9/+17
| | | |
| * | | don't mix unicode strings with utf8-in-byte-stringsMatthew Hodgson2018-07-011-2/+9
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | otherwise we explode with: ``` Traceback (most recent call last): File /usr/lib/python2.7/logging/handlers.py, line 78, in emit logging.FileHandler.emit(self, record) File /usr/lib/python2.7/logging/__init__.py, line 950, in emit StreamHandler.emit(self, record) File /usr/lib/python2.7/logging/__init__.py, line 887, in emit self.handleError(record) File /usr/lib/python2.7/logging/__init__.py, line 810, in handleError None, sys.stderr) File /usr/lib/python2.7/traceback.py, line 124, in print_exception _print(file, 'Traceback (most recent call last):') File /usr/lib/python2.7/traceback.py, line 13, in _print file.write(str+terminator) File /home/matrix/.synapse/local/lib/python2.7/site-packages/twisted/logger/_io.py, line 170, in write self.log.emit(self.level, format=u{log_io}, log_io=line) File /home/matrix/.synapse/local/lib/python2.7/site-packages/twisted/logger/_logger.py, line 144, in emit self.observer(event) File /home/matrix/.synapse/local/lib/python2.7/site-packages/twisted/logger/_observer.py, line 136, in __call__ errorLogger = self._errorLoggerForObserver(brokenObserver) File /home/matrix/.synapse/local/lib/python2.7/site-packages/twisted/logger/_observer.py, line 156, in _errorLoggerForObserver if obs is not observer File /home/matrix/.synapse/local/lib/python2.7/site-packages/twisted/logger/_observer.py, line 81, in __init__ self.log = Logger(observer=self) File /home/matrix/.synapse/local/lib/python2.7/site-packages/twisted/logger/_logger.py, line 64, in __init__ namespace = self._namespaceFromCallingContext() File /home/matrix/.synapse/local/lib/python2.7/site-packages/twisted/logger/_logger.py, line 42, in _namespaceFromCallingContext return currentframe(2).f_globals[__name__] File /home/matrix/.synapse/local/lib/python2.7/site-packages/twisted/python/compat.py, line 93, in currentframe for x in range(n + 1): RuntimeError: maximum recursion depth exceeded while calling a Python object Logged from file site.py, line 129 File /usr/lib/python2.7/logging/__init__.py, line 859, in emit msg = self.format(record) File /usr/lib/python2.7/logging/__init__.py, line 732, in format return fmt.format(record) File /usr/lib/python2.7/logging/__init__.py, line 471, in format record.message = record.getMessage() File /usr/lib/python2.7/logging/__init__.py, line 335, in getMessage msg = msg % self.args UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 4: ordinal not in range(128) Logged from file site.py, line 129 ``` ...where the logger apparently recurses whilst trying to log the error, hitting the maximum recursion depth and killing everything badly.
* | | Merge pull request #3467 from matrix-org/hawkowl/contributor-requirementsMatthew Hodgson2018-06-302-5/+9
|\ \ \ | | | | | | | | Clarify "real name" in contributor requirements
| * | | topfileAmber Brown2018-06-291-0/+0
| | | |
| * | | clarification on what "real names" areAmber Brown2018-06-291-5/+9
| | | |
* | | | Merge pull request #3456 from matrix-org/hawkowl/federation-prevevent-checkingErik Johnston2018-06-295-30/+319
|\ \ \ \ | | | | | | | | | | Check the state of prev_events a bit more thoroughly when coming over federation
| * | | | topfile updateAmber Brown2018-06-281-2/+1
| | | | |
| * | | | topfileAmber Brown2018-06-271-0/+2
| | | | |
| * | | | try and clean upAmber Brown2018-06-271-3/+6
| | | | |
| * | | | pep8Amber Brown2018-06-272-11/+6
| | | | |
| * | | | cleanupsAmber Brown2018-06-271-1/+4
| | | | |
| * | | | cleanupsAmber Brown2018-06-271-13/+15
| | | | |
| * | | | stylistic cleanupAmber Brown2018-06-271-6/+18
| | | | |
| * | | | cleanupsAmber Brown2018-06-271-7/+6
| | | | |
| * | | | handle federation not telling us about prev_eventsAmber Brown2018-06-274-27/+301
| | | | |
* | | | | Merge pull request #3465 from matrix-org/matthew/as_ip_lockMatthew Hodgson2018-06-285-5/+69
|\ \ \ \ \ | |_|/ / / |/| | | | add ip_range_whitelist parameter to limit where ASes can connect from
| * | | | add testMatthew Hodgson2018-06-281-0/+33
| | | | |
| * | | | add towncrier snippetMatthew Hodgson2018-06-281-0/+1
| | | | |
| * | | | fix testsMatthew Hodgson2018-06-282-3/+16
| | | | |