Commit graph

11328 commits

Author SHA1 Message Date
Richard van der Hoff
5c705f70c9 Fixes and optimisations for resolve_state_groups
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/.
2018-07-23 19:10:11 +01:00
Erik Johnston
f559119de0
Merge pull request #3584 from matrix-org/erikj/use_cached
Only get cached state from context in persist_event
2018-07-23 17:52:45 +01:00
Erik Johnston
8b9f164fff Comments 2018-07-23 17:43:01 +01:00
Erik Johnston
2d5bba151b Newsfile 2018-07-23 17:29:32 +01:00
Erik Johnston
50c60e5fad Only get cached state from context in persist_event
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.
2018-07-23 17:21:40 +01:00
Erik Johnston
a646bdc670
Merge pull request #3582 from matrix-org/erikj/fixup_stateless
Fix missing attributes on workers.
2018-07-23 16:44:42 +01:00
Erik Johnston
9f41ad491d Newsfile 2018-07-23 16:31:46 +01:00
Erik Johnston
0faa3223cd Fix missing attributes on workers.
This was missed during the transition from attribute to getter for
getting state from context.
2018-07-23 16:28:00 +01:00
Erik Johnston
37e87611bc
Merge pull request #3581 from matrix-org/erikj/fixup_stateless
Fix EventContext when using workers
2018-07-23 16:06:59 +01:00
Erik Johnston
a4d24781bf Newsfile 2018-07-23 15:28:51 +01:00
Erik Johnston
999bcf9d01 Fix EventContext when using workers
We were:
  1. Not correctly setting all attributes
  2. Using defer.inlineCallbacks in a non-generator
2018-07-23 15:24:21 +01:00
Erik Johnston
9c294ea864
Merge pull request #3579 from matrix-org/erikj/stateless_contexts_4
Add concept of StatelessContext, take 4.
2018-07-23 15:14:39 +01:00
Erik Johnston
4797ed000e Update docstrings to make sense 2018-07-23 15:05:56 +01:00
Richard van der Hoff
726a0b1e64
Merge branch 'develop' into erikj/stateless_contexts_4 2018-07-23 14:44:27 +01:00
Erik Johnston
f0a1b8e4cd
Merge pull request #3577 from matrix-org/erikj/cleanup_context
Refcator EventContext to accept state during init
2018-07-23 14:41:37 +01:00
Erik Johnston
8fbe418777 Fix unit tests 2018-07-23 13:33:49 +01:00
Erik Johnston
f3182bb1d0 Newsfile 2018-07-23 13:19:24 +01:00
Erik Johnston
027bc01a1b Add support for updating state 2018-07-23 13:17:25 +01:00
Erik Johnston
e42510ba63 Use new getters 2018-07-23 13:17:22 +01:00
Erik Johnston
440b8845b5 Make EventContext lazy load state 2018-07-23 12:56:56 +01:00
Erik Johnston
842cdece42 pep8 2018-07-23 12:31:35 +01:00
Erik Johnston
959f4b9074 Newsfile 2018-07-23 12:22:59 +01:00
Erik Johnston
acbfdc3442 Refcator EventContext to accept state during init 2018-07-23 12:20:55 +01:00
Matthew Hodgson
354a99c968
Merge pull request #3520 from matrix-org/matthew/sync_deleted_devices
Announce deleted devices explicitly over federation.
2018-07-23 10:16:05 +01:00
Matthew Hodgson
9b34f3ea3a
Merge branch 'develop' into matthew/sync_deleted_devices 2018-07-23 10:03:28 +01:00
Matthew Hodgson
c1bf2b587e
add trailing comma 2018-07-23 09:56:23 +01:00
Amber Brown
3132b89f12
Make the rest of the .iterwhatever go away (#3562) 2018-07-21 15:47:18 +10:00
Richard van der Hoff
ff48ab8527
Merge pull request #3572 from matrix-org/rav/linearizer_cancellation
Test and fix support for cancellation in Linearizer
2018-07-20 14:44:02 +01:00
Richard van der Hoff
5c30cb709a Changelog 2018-07-20 14:01:36 +01:00
Richard van der Hoff
3d6df84658 Test and fix support for cancellation in Linearizer 2018-07-20 13:59:55 +01:00
Richard van der Hoff
4f67623674
Merge pull request #3571 from matrix-org/rav/limiter_fixes
A set of improvements to the Limiter
2018-07-20 13:53:03 +01:00
Amber Brown
e1a237eaab
Admin API for creating new users (#3415) 2018-07-20 22:41:13 +10:00
Richard van der Hoff
683f4058c1 changelogs 2018-07-20 13:16:39 +01:00
Richard van der Hoff
7c712f95bb Combine Limiter and Linearizer
Linearizer was effectively a Limiter with max_count=1, so rather than
maintaining two sets of code, let's combine them.
2018-07-20 13:11:43 +01:00
Richard van der Hoff
8462c26485 Improvements to the Limiter
* give them names, to improve logging
* use a deque rather than a list for efficiency
2018-07-20 12:50:27 +01:00
Richard van der Hoff
d7275eecf3 Add a sleep to the Limiter to fix stack overflows.
Fixes #3570
2018-07-20 12:37:12 +01:00
Richard van der Hoff
7044af3298
Merge pull request #3564 from matrix-org/hawkowl/markdown
Switch changes to markdown & flip content on for miscs
2018-07-19 17:31:59 +01:00
Amber Brown
fd9b08873c Merge remote-tracking branch 'origin/develop' into hawkowl/markdown 2018-07-19 21:48:28 +10:00
Richard van der Hoff
11d592290c Merge branch 'master' into develop 2018-07-19 12:44:04 +01:00
Amber Brown
87086ac69d fixes 2018-07-19 21:42:40 +10:00
Amber Brown
7814e4cc86 fix up weird translation things 2018-07-19 21:37:57 +10:00
Richard van der Hoff
6284f579bf Update r0.33.0 release notes
(mostly just clarifications)
2018-07-19 12:37:55 +01:00
Amber Brown
7cf76c9a09 changelog 2018-07-19 21:26:30 +10:00
Amber Brown
37af0d2a13 make pyproject point at it 2018-07-19 21:25:47 +10:00
Amber Brown
252f80094c rst -> md 2018-07-19 21:25:33 +10:00
Amber Brown
9a8acdc720 Merge branch 'master' into develop 2018-07-19 21:16:44 +10:00
Amber Brown
d69decd5c7 0.33.0 final changelog 2018-07-19 21:12:15 +10:00
Amber Brown
38f53399a2 0.33 final 2018-07-19 21:11:40 +10:00
Amber Brown
13d501c773 update changelogs 2018-07-19 21:11:24 +10:00
Amber Brown
ce0545eca1 Revert "0.33.0rc1 changelog"
This reverts commit 21d3b87943.
2018-07-19 21:03:15 +10:00