Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Merge pull request #3155 from NotAFile/py3-bytes-1 | Richard van der Hoff | 2018-04-30 | 1 | -2/+5 |
|\ | | | | | more bytes strings | ||||
| * | more bytes strings | Adrian Tschira | 2018-04-29 | 1 | -2/+5 |
| | | | | | | | | Signed-off-by: Adrian Tschira <nota@notafile.com> | ||||
* | | Merge pull request #3140 from matrix-org/rav/use_run_in_background | Richard van der Hoff | 2018-04-30 | 5 | -9/+11 |
|\ \ | |/ |/| | Use run_in_background in preference to preserve_fn | ||||
| * | Merge remote-tracking branch 'origin/develop' into rav/use_run_in_background | Richard van der Hoff | 2018-04-27 | 1 | -1/+6 |
| |\ | |||||
| * | | Use run_in_background in preference to preserve_fn | Richard van der Hoff | 2018-04-27 | 5 | -9/+11 |
| | | | | | | | | | | | | | | | | | | While I was going through uses of preserve_fn for other PRs, I converted places which only use the wrapped function once to use run_in_background, to avoid creating the function object. | ||||
* | | | Merge remote-tracking branch 'origin/develop' into rav/deferred_timeout | Richard van der Hoff | 2018-04-27 | 1 | -1/+6 |
|\ \ \ | | |/ | |/| | |||||
| * | | Improve exception handling for background processes | Richard van der Hoff | 2018-04-27 | 1 | -1/+6 |
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. | ||||
* | | Backport deferred.addTimeout | Richard van der Hoff | 2018-04-27 | 1 | -0/+67 |
| | | | | | | | | Twisted 16.0 doesn't have addTimeout, so let's backport it. | ||||
* | | Use deferred.addTimeout instead of time_bound_deferred | Richard van der Hoff | 2018-04-23 | 1 | -56/+0 |
|/ | | | | This doesn't feel like a wheel we need to reinvent. | ||||
* | Merge pull request #3107 from NotAFile/py3-bool-nonzero | Richard van der Hoff | 2018-04-20 | 1 | -0/+1 |
|\ | | | | | add __bool__ alias to __nonzero__ methods | ||||
| * | add __bool__ alias to __nonzero__ methods | Adrian Tschira | 2018-04-15 | 1 | -0/+1 |
| | | | | | | | | Signed-off-by: Adrian Tschira <nota@notafile.com> | ||||
* | | Merge pull request #3110 from NotAFile/py3-six-queue | Richard van der Hoff | 2018-04-20 | 1 | -2/+2 |
|\ \ | | | | | | | Replace Queue with six.moves.queue | ||||
| * | | Replace Queue with six.moves.queue | Adrian Tschira | 2018-04-16 | 1 | -2/+2 |
| |/ | | | | | | | | | | | and a six.range change which I missed the last time Signed-off-by: Adrian Tschira <nota@notafile.com> | ||||
* | | Merge pull request #3093 from matrix-org/rav/response_cache_wrap | Richard van der Hoff | 2018-04-20 | 1 | -14/+74 |
|\ \ | |/ |/| | Refactor ResponseCache usage | ||||
| * | ResponseCache: fix handling of completed results | Richard van der Hoff | 2018-04-13 | 1 | -13/+19 |
| | | | | | | | | | | Turns out that ObservableDeferred.observe doesn't return a deferred if the result is already completed. Fix handling and improve documentation. | ||||
| * | Refactor ResponseCache usage | Richard van der Hoff | 2018-04-12 | 1 | -2/+56 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds a `.wrap` method to ResponseCache which wraps up the boilerplate of a (get, set) pair, and then use it throughout the codebase. This will be largely non-functional, but does include the following functional changes: * federation_server.on_context_state_request: drops use of _server_linearizer which looked redundant and could cause incorrect cache misses by yielding between the get and the set. * RoomListHandler.get_remote_public_room_list(): fixes logcontext leaks * the wrap function includes some logging. I'm hoping this won't be too noisy on production. | ||||
* | | Revert "Use sortedcontainers instead of blist" | Richard van der Hoff | 2018-04-13 | 1 | -2/+2 |
|/ | | | | | | | | | | | This reverts commit 9fbe70a7dc3afabfdac176ba1f4be32dd44602aa. It turns out that sortedcontainers.SortedDict is not an exact match for blist.sorteddict; in particular, `popitem()` removes things from the opposite end of the dict. This is trivial to fix, but I want to add some unit tests, and potentially some more thought about it, before we do so. | ||||
* | Merge pull request #3092 from matrix-org/rav/response_cache_metrics | Richard van der Hoff | 2018-04-12 | 1 | -1/+13 |
|\ | | | | | Add metrics for ResponseCache | ||||
| * | Add metrics for ResponseCache | Richard van der Hoff | 2018-04-10 | 1 | -1/+13 |
| | | |||||
* | | Merge pull request #3059 from matrix-org/rav/doc_response_cache | Richard van der Hoff | 2018-04-12 | 1 | -0/+32 |
|\ \ | | | | | | | Document the behaviour of ResponseCache | ||||
| * | | Document the behaviour of ResponseCache | Richard van der Hoff | 2018-04-04 | 1 | -0/+32 |
| | | | | | | | | | | | | | | | | | | it looks like everything that uses ResponseCache expects to have to `make_deferred_yieldable` its results. It's debatable whether that is the best approach, but let's document it for now to avoid further confusion. | ||||
* | | | Use sortedcontainers instead of blist | Vincent Breitmoser | 2018-04-10 | 1 | -2/+2 |
| |/ |/| | | | | | | | | | | | | | This commit drop-in replaces blist with SortedContainers. They are written in pure python so work with pypy, but perform as good as native implementations, at least in a couple benchmarks: http://www.grantjenks.com/docs/sortedcontainers/performance.html | ||||
* | | Revert "Merge pull request #3066 from matrix-org/rav/remove_redundant_metrics" | Richard van der Hoff | 2018-04-09 | 1 | -0/+25 |
| | | | | | | | | | | | | | | We aren't ready to release this yet, so I'm reverting it for now. This reverts commit d1679a4ed7947b0814e0f2af9b888a16c588f1a1, reversing changes made to e089100c6231541c446e37e157dec8feed02d283. | ||||
* | | Merge pull request #3068 from matrix-org/rav/fix_cache_invalidation | Richard van der Hoff | 2018-04-05 | 1 | -26/+38 |
|\ \ | | | | | | | Improve database cache performance | ||||
| * | | Fix overzealous cache invalidation | Richard van der Hoff | 2018-04-05 | 1 | -26/+38 |
| | | | | | | | | | | | | | | | Fixes an issue where a cache invalidation would invalidate *all* pending entries, rather than just the entry that we intended to invalidate. | ||||
* | | | Remove redundant metrics which were deprecated in 0.27.0. | Richard van der Hoff | 2018-04-04 | 1 | -25/+0 |
|/ / | |||||
* / | Use static JSONEncoders | Richard van der Hoff | 2018-03-29 | 1 | -0/+19 |
|/ | | | | | using json.dumps with custom options requires us to create a new JSONEncoder on each call. It's more efficient to create one upfront and reuse it. | ||||
* | 404 correctly on missing paths via NoResource | Matthew Hodgson | 2018-03-23 | 1 | -2/+2 |
| | | | | fixes https://github.com/matrix-org/synapse/issues/2043 and https://github.com/matrix-org/synapse/issues/2029 | ||||
* | Add comments | Erik Johnston | 2018-03-19 | 1 | -0/+7 |
| | |||||
* | Fix bug where state cache used lots of memory | Erik Johnston | 2018-03-15 | 2 | -5/+9 |
| | | | | | | | | | The state cache bases its size on the sum of the size of entries. The size of the entry is calculated once on insertion, so it is important that the size of entries does not change. The DictionaryCache modified the entries size, which caused the state cache to incorrectly think it was smaller than it actually was. | ||||
* | Factor run_in_background out from preserve_fn | Richard van der Hoff | 2018-03-08 | 1 | -24/+29 |
| | | | | | It annoys me that we create temporary function objects when there's really no need for it. Let's factor the gubbins out of preserve_fn and start using it. | ||||
* | Rewrite make_deferred_yieldable avoiding inlineCallbacks | Richard van der Hoff | 2018-03-01 | 1 | -9/+11 |
| | | | | | ... because (a) it's actually simpler (b) it might be marginally more performant? | ||||
* | report metrics on number of cache evictions | Richard van der Hoff | 2018-02-05 | 3 | -4/+34 |
| | |||||
* | Add federation_domain_whitelist option (#2820) | Matthew Hodgson | 2018-01-22 | 1 | -0/+12 |
| | | | | | | Add federation_domain_whitelist gives a way to restrict which domains your HS is allowed to federate with. useful mainly for gracefully preventing a private but internet-connected HS from trying to federate to the wider public Matrix network | ||||
* | Merge pull request #2813 from matrix-org/matthew/registrations_require_3pid | Matthew Hodgson | 2018-01-22 | 1 | -0/+48 |
|\ | | | | | add registrations_require_3pid and allow_local_3pids | ||||
| * | fix PR nitpicking | Matthew Hodgson | 2018-01-19 | 1 | -3/+6 |
| | | |||||
| * | rewrite based on PR feedback: | Matthew Hodgson | 2018-01-19 | 1 | -0/+45 |
| | | | | | | | | | | | | | | | | | | * [ ] split config options into allowed_local_3pids and registrations_require_3pid * [ ] simplify and comment logic for picking registration flows * [ ] fix docstring and move check_3pid_allowed into a new util module * [ ] use check_3pid_allowed everywhere @erikjohnston PTAL | ||||
* | | Merge pull request #2804 from matrix-org/erikj/file_consumer | Erik Johnston | 2018-01-18 | 1 | -0/+139 |
|\ \ | | | | | | | Add decent impl of a FileConsumer | ||||
| * | | Do logcontexts correctly | Erik Johnston | 2018-01-18 | 1 | -2/+2 |
| | | | |||||
| * | | Move test stuff to tests | Erik Johnston | 2018-01-18 | 1 | -25/+1 |
| | | | |||||
| * | | Make all fields private | Erik Johnston | 2018-01-18 | 1 | -31/+31 |
| | | | |||||
| * | | Ensure we registerProducer isn't called twice | Erik Johnston | 2018-01-18 | 1 | -0/+3 |
| | | | |||||
| * | | Fix _notify_empty typo | Erik Johnston | 2018-01-18 | 1 | -1/+1 |
| | | | |||||
| * | | Move definition of paused_producer to __init__ | Erik Johnston | 2018-01-18 | 1 | -2/+4 |
| | | | |||||
| * | | Fix comments | Erik Johnston | 2018-01-18 | 1 | -3/+3 |
| | | | |||||
| * | | Add decent impl of a FileConsumer | Erik Johnston | 2018-01-17 | 1 | -0/+158 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Twisted core doesn't have a general purpose one, so we need to write one ourselves. Features: - All writing happens in background thread - Supports both push and pull producers - Push producers get paused if the consumer falls behind | ||||
* | | | Fix bugs in block metrics | Richard van der Hoff | 2018-01-18 | 1 | -2/+4 |
| |/ |/| | | | | | ... which I introduced in #2785 | ||||
* | | Track DB scheduling delay per-request | Richard van der Hoff | 2018-01-16 | 2 | -2/+30 |
| | | | | | | | | | | | | For each request, track the amount of time spent waiting for a db connection. This entails adding it to the LoggingContext and we may as well add metrics for it while we are passing. | ||||
* | | Track db txn time in millisecs | Richard van der Hoff | 2018-01-16 | 2 | -6/+11 |
| | | | | | | | | ... to reduce the amount of floating-point foo we do. | ||||
* | | Optimise LoggingContext creation and copying | Richard van der Hoff | 2018-01-16 | 1 | -7/+18 |
|/ | | | | | | | | It turns out that the only thing we use the __dict__ of LoggingContext for is `request`, and given we create lots of LoggingContexts and then copy them every time we do a db transaction or log line, using the __dict__ seems a bit redundant. Let's try to optimise things by making the request attribute explicit. | ||||
* | Reorganise request and block metrics | Richard van der Hoff | 2018-01-15 | 1 | -11/+42 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to circumvent the number of duplicate foo:count metrics increasing without bounds, it's time for a rearrangement. The following are all deprecated, and replaced with synapse_util_metrics_block_count: synapse_util_metrics_block_timer:count synapse_util_metrics_block_ru_utime:count synapse_util_metrics_block_ru_stime:count synapse_util_metrics_block_db_txn_count:count synapse_util_metrics_block_db_txn_duration:count The following are all deprecated, and replaced with synapse_http_server_response_count: synapse_http_server_requests synapse_http_server_response_time:count synapse_http_server_response_ru_utime:count synapse_http_server_response_ru_stime:count synapse_http_server_response_db_txn_count:count synapse_http_server_response_db_txn_duration:count The following are renamed (the old metrics are kept for now, but deprecated): synapse_util_metrics_block_timer:total -> synapse_util_metrics_block_time_seconds synapse_util_metrics_block_ru_utime:total -> synapse_util_metrics_block_ru_utime_seconds synapse_util_metrics_block_ru_stime:total -> synapse_util_metrics_block_ru_stime_seconds synapse_util_metrics_block_db_txn_count:total -> synapse_util_metrics_block_db_txn_count synapse_util_metrics_block_db_txn_duration:total -> synapse_util_metrics_block_db_txn_duration_seconds synapse_http_server_response_time:total -> synapse_http_server_response_time_seconds synapse_http_server_response_ru_utime:total -> synapse_http_server_response_ru_utime_seconds synapse_http_server_response_ru_stime:total -> synapse_http_server_response_ru_stime_seconds synapse_http_server_response_db_txn_count:total -> synapse_http_server_response_db_txn_count synapse_http_server_response_db_txn_duration:total synapse_http_server_response_db_txn_duration_seconds | ||||
* | Remove __PreservingContextDeferred too | Richard van der Hoff | 2017-11-14 | 1 | -30/+0 |
| | |||||
* | Remove preserve_context_over_{fn, deferred} | Richard van der Hoff | 2017-11-14 | 3 | -49/+10 |
| | | | | | Both of these functions ae known to leak logcontexts. Replace the remaining calls to them and kill them off. | ||||
* | Logging and logcontext fixes for Limiter | Richard van der Hoff | 2017-11-07 | 1 | -7/+17 |
| | | | | | | | | | Add some logging to the Limiter in a similar spirit to the Linearizer, to help debug issues. Also fix a logcontext leak. Also refactor slightly to avoid throwing exceptions. | ||||
* | fix vars named `l` | Richard van der Hoff | 2017-10-23 | 2 | -7/+4 |
| | | | | E741 says "do not use variables named ‘l’, ‘O’, or ‘I’". | ||||
* | replace 'except:' with 'except Exception:' | Richard van der Hoff | 2017-10-23 | 4 | -11/+11 |
| | | | | what could possibly go wrong | ||||
* | Fix logcontext handling for persist_events | Richard van der Hoff | 2017-10-17 | 1 | -0/+5 |
| | | | | | | | | * don't use preserve_context_over_deferred, which is known broken. * remove a redundant preserve_fn. * add/improve some comments | ||||
* | Merge pull request #2532 from matrix-org/rav/fix_linearizer | Richard van der Hoff | 2017-10-11 | 1 | -2/+22 |
|\ | | | | | Fix stackoverflow and logcontexts from linearizer | ||||
| * | Fix stackoverflow and logcontexts from linearizer | Richard van der Hoff | 2017-10-11 | 1 | -2/+22 |
| | | | | | | | | | | | | | | 1. make it not blow out the stack when there are more than 50 things waiting for a lock. Fixes https://github.com/matrix-org/synapse/issues/2505. 2. Make it not mess up the log contexts. | ||||
* | | logformatter: fix AttributeError | Richard van der Hoff | 2017-10-11 | 1 | -3/+11 |
| | | | | | | | | make sure we have the relevant fields before we try to log them. | ||||
* | | Fancy logformatter to format exceptions better | Richard van der Hoff | 2017-10-09 | 1 | -0/+43 |
|/ | | | | | | | | | This is a bit of an experimental change at this point; the idea is to see if it helps us track down where our stack overflows are coming from by logging the stack when the exception was caught and turned into a Failure. (We'll also need https://github.com/richvdh/twisted/commit/edf27044200e74680ea67c525768e36dc9d9af2b). If we deploy this, we'll be able to enable it via the log config yaml. | ||||
* | Fix logcontext handling for concurrently_execute | Richard van der Hoff | 2017-10-06 | 1 | -2/+2 |
| | | | | Avoid preserve_context_over_deferred, which is broken. | ||||
* | pep8 | David Baker | 2017-09-26 | 1 | -0/+1 |
| | |||||
* | unnecessary parens | David Baker | 2017-09-26 | 1 | -1/+1 |
| | |||||
* | Add module_loader.py | David Baker | 2017-09-26 | 1 | -0/+41 |
| | |||||
* | Increase default cache factor size. | Erik Johnston | 2017-07-04 | 1 | -1/+1 |
| | |||||
* | Define CACHE_SIZE_FACTOR once | Erik Johnston | 2017-07-04 | 2 | -9/+2 |
| | |||||
* | Use an ExpiringCache for storing registration sessions | Erik Johnston | 2017-06-29 | 1 | -0/+3 |
| | | | | | This is because pruning them was a significant performance drain on matrix.org | ||||
* | Rewrite conditional | Erik Johnston | 2017-06-09 | 1 | -1/+1 |
| | |||||
* | Fix has_any_entity_changed | Erik Johnston | 2017-06-09 | 1 | -4/+4 |
| | | | | | | | | Occaisonally has_any_entity_changed would throw the error: "Set changed size during iteration" when taking the max of the `sorteddict`. While its uncertain how that happens, its quite inefficient to iterate over the entire dict anyway so we change to using the more traditional `bisect_*` functions. | ||||
* | Add stream change cache | Erik Johnston | 2017-05-31 | 1 | -0/+15 |
| | |||||
* | Pull out if statement from for loop | Erik Johnston | 2017-05-22 | 1 | -6/+14 |
| | |||||
* | Update list cache to handle one arg case | Erik Johnston | 2017-05-22 | 1 | -17/+33 |
| | | | | | | We update the normal cache descriptors to handle caches with a single argument specially so that the key wasn't a 1-tuple. We need to update the cache list to be aware of this. | ||||
* | Make get_state_groups_from_groups faster. | Erik Johnston | 2017-05-17 | 1 | -11/+46 |
| | | | | | | | | | Most of the time was spent copying a dict to filter out sentinel values that indicated that keys did not exist in the dict. The sentinel values were added to ensure that we cached the non-existence of keys. By updating DictionaryCache to keep track of which keys were known to not exist itself we can remove a dictionary copy. | ||||
* | Don't update event cache hit ratio from get_joined_users | Erik Johnston | 2017-05-08 | 1 | -3/+6 |
| | | | | | Otherwise the hit ration of plain get_events gets completely skewed by calls to get_joined_users* functions. | ||||
* | Optimise caches with single key | Erik Johnston | 2017-05-04 | 1 | -9/+33 |
| | |||||
* | Instantiate DeferredTimedOutError correctly | Richard van der Hoff | 2017-05-02 | 1 | -1/+1 |
| | | | | | | Call `super` correctly, so that we correctly initialise the `errcode` field. Fixes https://github.com/matrix-org/synapse/issues/2179. | ||||
* | Reduce size of joined_user cache | Erik Johnston | 2017-04-25 | 1 | -0/+14 |
| | | | | | | | | The _get_joined_users_from_context cache stores a mapping from user_id to avatar_url and display_name. Instead of storing those in a dict, store them in a namedtuple as that uses much less memory. We also try converting the string to ascii to further reduce the size. | ||||
* | Remove DEBUG_CACHES | Erik Johnston | 2017-04-25 | 1 | -2/+0 |
| | |||||
* | Reduce cache size by not storing deferreds | Erik Johnston | 2017-04-25 | 1 | -18/+21 |
| | | | | | | | | | | | | | | | | | | | | Currently the cache descriptors store deferreds rather than raw values, this is a simple way of triggering only one database hit and sharing the result if two callers attempt to get the same value. However, there are a few caches that simply store a mapping from string to string (or int). These caches can have a large number of entries, under the assumption that each entry is small. However, the size of a deferred (specifically the size of ObservableDeferred) is signigicantly larger than that of the raw value, 2kb vs 32b. This PR therefore changes the cache descriptors to store the raw values rather than the deferreds. As a side effect cached storage function now either return a deferred or the actual value, as the cached list decriptor already does. This is fine as we always end up just yield'ing on the returned value eventually, which handles that case correctly. | ||||
* | Only intern ascii strings | Erik Johnston | 2017-04-24 | 1 | -18/+11 |
| | |||||
* | Fix fixme in preserve_fn | Richard van der Hoff | 2017-04-03 | 1 | -5/+1 |
| | | | | | `preserve_fn` is no longer used as a decorator anywhere, so we can safely fix a fixme therein. | ||||
* | Remove unused instance variable | Erik Johnston | 2017-03-31 | 1 | -4/+0 |
| | |||||
* | Docs | Erik Johnston | 2017-03-30 | 1 | -0/+5 |
| | |||||
* | Revert log context change | Erik Johnston | 2017-03-30 | 1 | -3/+0 |
| | |||||
* | Doc new instance variables | Erik Johnston | 2017-03-30 | 1 | -1/+8 |
| | |||||
* | Manually calculate cache key as getcallargs is expensive | Erik Johnston | 2017-03-30 | 1 | -6/+28 |
| | | | | | This is because getcallargs recomputes the getargspec, amongst other things, which we don't need to do as its already been done | ||||
* | Don't convert to deferreds when not necessary | Erik Johnston | 2017-03-30 | 3 | -2/+8 |
| | |||||
* | Fix the logcontext handling in the cache wrappers (#2077) | Richard van der Hoff | 2017-03-30 | 2 | -16/+37 |
| | | | | | | | The cache wrappers had a habit of leaking the logcontext into the reactor while the lookup function was running, and then not restoring it correctly when the lookup function had completed. It's all the fault of `preserve_context_over_{fn,deferred}` which are basically a bit broken. | ||||
* | Merge pull request #2050 from matrix-org/rav/federation_backoff | Richard van der Hoff | 2017-03-23 | 1 | -4/+25 |
|\ | | | | | push federation retry limiter down to matrixfederationclient | ||||
| * | Ignore backoff history for invites, aliases, and roomdirs | Richard van der Hoff | 2017-03-23 | 1 | -2/+11 |
| | | | | | | | | | | Add a param to the federation client which lets us ignore historical backoff data for federation queries, and set it for a handful of operations. | ||||
| * | push federation retry limiter down to matrixfederationclient | Richard van der Hoff | 2017-03-23 | 1 | -2/+14 |
| | | | | | | | | | | rather than having to instrument everywhere we make a federation call, make the MatrixFederationHttpClient manage the retry limiter. | ||||
* | | Merge pull request #2052 from matrix-org/rav/time_bound_deferred | Richard van der Hoff | 2017-03-23 | 1 | -4/+6 |
|\ \ | | | | | | | Fix time_bound_deferred to throw the right exception | ||||
| * | | Fix time_bound_deferred to throw the right exception | Richard van der Hoff | 2017-03-23 | 1 | -4/+6 |
| |/ | | | | | | | | | | | Due to a failure to instantiate DeferredTimedOutError, time_bound_deferred would throw a CancelledError when the deferred timed out, which was rather confusing. | ||||
* | | Fix a couple of logcontext leaks | Richard van der Hoff | 2017-03-23 | 1 | -2/+3 |
| | | | | | | | | | | Use preserve_fn to correctly manage the logcontexts around things we don't want to yield on. | ||||
* | | Fix caching of remote servers' signature keys | Richard van der Hoff | 2017-03-22 | 1 | -63/+72 |
|/ | | | | | | | | | The `@cached` decorator on `KeyStore._get_server_verify_key` was missing its `num_args` parameter, which meant that it was returning the wrong key for any server which had more than one recorded key. By way of a fix, change the default for `num_args` to be *all* arguments. To implement that, factor out a common base class for `CacheDescriptor` and `CacheListDescriptor`. | ||||
* | Merge pull request #2026 from matrix-org/rav/logcontext_docs | Richard van der Hoff | 2017-03-20 | 1 | -0/+10 |
|\ | | | | | Logcontext docs | ||||
| * | Logcontext docs | Richard van der Hoff | 2017-03-17 | 1 | -0/+10 |
| | | |||||
* | | Stop preserve_fn leaking context into the reactor | Richard van der Hoff | 2017-03-18 | 1 | -32/+29 |
|/ | | | | | | | | Fix a bug in ``logcontext.preserve_fn`` which made it leak context into the reactor, and add a test for it. Also, get rid of ``logcontext.reset_context_after_deferred``, which tried to do the same thing but had its own, different, set of bugs. | ||||
* | Merge pull request #2016 from matrix-org/rav/queue_pdus_during_join | Richard van der Hoff | 2017-03-17 | 1 | -0/+25 |
|\ | | | | | Queue up federation PDUs while a room join is in progress | ||||
| * | Implement reset_context_after_deferred | Richard van der Hoff | 2017-03-15 | 1 | -0/+25 |
| | | | | | | | | | | to correctly reset the context when we fire off a deferred we aren't going to wait for. | ||||
* | | Fix assertion to stop transaction queue getting wedged | Richard van der Hoff | 2017-03-15 | 1 | -1/+1 |
| | | | | | | | | | | | | | | | | ... and update some docstrings to correctly reflect the types being used. get_new_device_msgs_for_remote can return a long under some circumstances, which was being stored in last_device_list_stream_id_by_dest, and was then upsetting things on the next loop. | ||||
* | | Support registration / login with phone number | David Baker | 2017-03-13 | 1 | -0/+40 |
|/ | | | | Changes from https://github.com/matrix-org/synapse/pull/1971 | ||||
* | Revert "Support registration & login with phone number" | Erik Johnston | 2017-03-13 | 1 | -40/+0 |
| | |||||
* | Add setdefault key to ExpiringCache | Erik Johnston | 2017-03-10 | 1 | -0/+7 |
| | |||||
* | Docs | David Baker | 2017-03-08 | 1 | -0/+13 |
| | |||||
* | Incorrectly copied copyright | David Baker | 2017-03-08 | 1 | -1/+0 |
| | | | | This file post-dates OM | ||||
* | pep8 | David Baker | 2017-03-08 | 1 | -0/+1 |
| | |||||
* | Add msisdn util file | David Baker | 2017-03-08 | 1 | -0/+27 |
| | |||||
* | Comment | Erik Johnston | 2017-02-02 | 1 | -1/+4 |
| | |||||
* | Comment | Erik Johnston | 2017-02-02 | 1 | -0/+2 |
| | |||||
* | Correctly raise exceptions for ratelimitng. Ratelimit on 401 | Erik Johnston | 2017-02-01 | 1 | -3/+5 |
| | |||||
* | Remove explicit < 400 check as apparently this is confusing | Erik Johnston | 2017-01-31 | 1 | -3/+1 |
| | |||||
* | Comment | Erik Johnston | 2017-01-31 | 1 | -0/+2 |
| | |||||
* | Comment | Erik Johnston | 2017-01-31 | 1 | -0/+4 |
| | |||||
* | Better handle 404 response for federation /send/ | Erik Johnston | 2017-01-31 | 1 | -2/+13 |
| | |||||
* | Update LruCache size estimate on clear | Erik Johnston | 2017-01-18 | 1 | -0/+2 |
| | |||||
* | Measure metrics of string_cache | Erik Johnston | 2017-01-17 | 1 | -3/+8 |
| | |||||
* | Fix typo in return type | Erik Johnston | 2017-01-17 | 1 | -3/+2 |
| | |||||
* | Rename and comment tree_to_leaves_iterator | Erik Johnston | 2017-01-17 | 2 | -5/+8 |
| | |||||
* | Remove needless call to evict() | Erik Johnston | 2017-01-17 | 1 | -1/+0 |
| | |||||
* | Speed up cache size calculation | Erik Johnston | 2017-01-17 | 5 | -46/+128 |
| | | | | | | | | | | | Instead of calculating the size of the cache repeatedly, which can take a long time now that it can use a callback, instead cache the size and update that on insertion and deletion. This requires changing the cache descriptors to have two caches, one for pending deferreds and the other for the actual values. There's no reason to evict from the pending deferreds as they won't take up any more memory. | ||||
* | Use OrderedDict in ExpiringCache | Erik Johnston | 2017-01-16 | 1 | -10/+4 |
| | |||||
* | Add support for 'iterable' to ExpiringCache | Erik Johnston | 2017-01-16 | 1 | -9/+17 |
| | |||||
* | Optionally measure size of cache by sum of length of values | Erik Johnston | 2017-01-13 | 2 | -19/+38 |
| | |||||
* | Remove full_twisted_stacktraces option | Erik Johnston | 2017-01-12 | 1 | -71/+0 |
| | | | | | | | | | | | | | | | | | The debug 'full_twisted_stacktraces' flag caused synapse to rewrite twisted deferreds to always fire the callback on the next reactor tick. This was to force the deferred to always store the stacktraces on exceptions, and thus be more likely to have a full stacktrace when it reaches the final error handlers and gets printed to the logs. Dynamically rewriting things is generally bad, and in particular this change violates assumptions of various bits of Twisted. This wouldn't necessarily be so bad, but it turns out this option has been turned on on some production servers. Turning the option can cause e.g. #1778. For now, lets just entirely nuke this option. | ||||
* | Add paranoia exception catch in Linearizer | Erik Johnston | 2017-01-10 | 1 | -2/+5 |
| | |||||
* | More logging for the linearizer and for get_events | Mark Haines | 2017-01-05 | 1 | -2/+11 |
| | |||||
* | s/aquire/acquire/g | Mark Haines | 2016-12-30 | 1 | -1/+1 |
| | |||||
* | Add more useful logging when we block fetching events | Mark Haines | 2016-12-30 | 1 | -0/+5 |
| | |||||
* | Merge pull request #1620 from matrix-org/erikj/concurrent_room_access | Erik Johnston | 2016-12-12 | 1 | -0/+58 |
|\ | | | | | Limit the number of events that can be created on a given room concurrently | ||||
| * | Comments | Erik Johnston | 2016-11-11 | 1 | -0/+13 |
| | | |||||
| * | Add Limiter: limit concurrent access to resource | Erik Johnston | 2016-11-10 | 1 | -0/+45 |
| | | |||||
* | | Correctly handle timeout errors | Erik Johnston | 2016-12-09 | 1 | -1/+6 |
| | | |||||
* | | Use correct var | Erik Johnston | 2016-11-24 | 1 | -1/+1 |
| | | |||||
* | | Correctly handle 500's and 429 on federation | Erik Johnston | 2016-11-24 | 1 | -1/+1 |
| | | |||||
* | | Invalidate retry cache in both directions | Erik Johnston | 2016-11-22 | 1 | -9/+12 |
| | | |||||
* | | Handle sending events and device messages over federation | Erik Johnston | 2016-11-17 | 1 | -3/+14 |
| | | |||||
* | | Use external ldap auth pacakge | Erik Johnston | 2016-11-15 | 1 | -369/+0 |
| | | |||||
* | | Clean transactions based on time. Add HttpTransactionCache tests. | Kegan Dougal | 2016-11-14 | 1 | -1/+9 |
|/ | |||||
* | Explicitly set authentication mode in ldap3 | Erik Johnston | 2016-11-08 | 1 | -1/+2 |
| | | | | | | This only makes a difference for versions of ldap3 before 1.0, but a) its best to be explicit and b) there are distributions that package ancient versions for ldap3 (e.g. debian). | ||||
* | Implement pluggable password auth | Erik Johnston | 2016-10-03 | 1 | -0/+368 |
| | | | | | | Allows delegating the password auth to an external module. This also moves the LDAP auth to using this system, allowing it to be removed from the synapse tree entirely in the future. | ||||
* | Change get_pos_of_last_change to return upper bound | Erik Johnston | 2016-09-15 | 1 | -3/+4 |
| | |||||
* | Use stream_change cache to make get_forward_extremeties_for_room cache more ↵ | Erik Johnston | 2016-09-15 | 1 | -0/+5 |
| | | | | effective | ||||
* | Fix up push to use get_current_state_ids | Erik Johnston | 2016-08-25 | 1 | -176/+0 |
| | |||||
* | Preserve some logcontexts | Erik Johnston | 2016-08-24 | 2 | -8/+16 |
| | |||||
* | Merge pull request #1031 from matrix-org/erikj/measure_notifier | Erik Johnston | 2016-08-22 | 1 | -1/+1 |
|\ | | | | | Add more Measure blocks | ||||
| * | Only abort Measure on Exceptions | Erik Johnston | 2016-08-19 | 1 | -1/+1 |
| | | |||||
* | | Ensure invalidation list does not grow unboundedly | Erik Johnston | 2016-08-19 | 2 | -20/+16 |
| | | |||||
* | | Rename to on_invalidate | Erik Johnston | 2016-08-19 | 1 | -16/+10 |
| | | |||||
* | | Make cache_context an explicit option | Erik Johnston | 2016-08-19 | 1 | -8/+27 |
| | | |||||
* | | Remove lru option | Erik Johnston | 2016-08-19 | 1 | -23/+8 |
| | | |||||
* | | Add concept of cache contexts | Erik Johnston | 2016-08-19 | 3 | -20/+99 |
|/ | |||||
* | Clean up TransactionQueue | Erik Johnston | 2016-08-10 | 2 | -3/+1 |
| | |||||
* | Measure federation send transaction resources | Erik Johnston | 2016-08-10 | 1 | -0/+14 |
| | |||||
* | Add federation /version API | Erik Johnston | 2016-08-05 | 1 | -4/+4 |
| | |||||
* | Merge pull request #940 from matrix-org/erikj/fed_state_cache | Erik Johnston | 2016-08-02 | 1 | -2/+11 |
|\ | | | | | Cache federation state responses | ||||
| * | Cache federation state responses | Erik Johnston | 2016-07-21 | 1 | -2/+11 |
| | | |||||
* | | Fix retry utils to check if the exception is a subclass of CME | Mark Haines | 2016-07-28 | 1 | -1/+1 |
| | | |||||
* | | Don't include name of room for invites in push | David Baker | 2016-07-28 | 1 | -1/+4 |
| | | | | | | | | Avoids insane pushes like, "Bob invited you to invite from Bob" | ||||
* | | typo | Matthew Hodgson | 2016-07-26 | 1 | -1/+1 |
|/ | |||||
* | Add ReadWriteLock | Erik Johnston | 2016-07-05 | 1 | -0/+82 |
| | |||||
* | Use similar naming we use in email notifs for push | David Baker | 2016-06-24 | 1 | -1/+4 |
| | | | | Fixes https://github.com/vector-im/vector-web/issues/1654 | ||||
* | Remove registered_users from the distributor. | Mark Haines | 2016-06-17 | 1 | -4/+0 |
| | | | | | | | | | | The only place that was observed was to set the profile. I've made it so that the profile is set within store.register in the same transaction that creates the user. This required some slight changes to the registration code for upgrading guest users, since it previously relied on the distributor swallowing errors if the profile already existed. | ||||
* | Merge branch 'erikj/cache_perf' of github.com:matrix-org/synapse into develop | Erik Johnston | 2016-06-03 | 2 | -10/+34 |
|\ | |||||
| * | Pull out update_results_dict | Erik Johnston | 2016-06-03 | 1 | -8/+7 |
| | | |||||
| * | Small optimisation to CacheListDescriptor | Erik Johnston | 2016-06-03 | 2 | -2/+11 |
| | | |||||
| * | Make cachedList go a bit faster | Erik Johnston | 2016-06-03 | 1 | -10/+34 |
| | | |||||
* | | Change CacheMetrics to be quicker | Erik Johnston | 2016-06-03 | 5 | -25/+44 |
|/ | | | | | | We change it so that each cache has an individual CacheMetric, instead of having one global CacheMetric. This means that when a cache tries to increment a counter it does not need to go through so many indirections. | ||||
* | catch thinko in presentable names | Matthew Hodgson | 2016-05-23 | 1 | -4/+15 |
| | |||||
* | Docstring | David Baker | 2016-04-29 | 1 | -0/+14 |
| | |||||
* | pep8 newline | David Baker | 2016-04-29 | 1 | -1/+1 |
| | |||||
* | Merge remote-tracking branch 'origin/develop' into dbkr/email_notifs | David Baker | 2016-04-29 | 2 | -0/+168 |
|\ | |||||
| * | Add a metrics listener and a ssh listener to the pusher | Mark Haines | 2016-04-25 | 1 | -1/+25 |
| | | |||||
| * | Move the listenTCP call outside the manhole function | Mark Haines | 2016-04-25 | 1 | -9/+5 |
| | | |||||
| * | Split out setting up the manhole to a separate file | Mark Haines | 2016-04-22 | 1 | -0/+50 |
| | | |||||
| * | Split out create_resource_tree to a separate file | Mark Haines | 2016-04-22 | 1 | -0/+98 |
| | | |||||
* | | Handle room invites in email notifs | David Baker | 2016-04-28 | 1 | -3/+3 |
| | | |||||
* | | More variable calculation for email notifs | David Baker | 2016-04-25 | 1 | -16/+19 |
| | | | | | | | | Include name of the person we're sending to and add summary text at the top giving an overview of what's happened. | ||||
* | | Typo | David Baker | 2016-04-25 | 1 | -1/+1 |
| | | |||||
* | | No we don't: it's just the display name | David Baker | 2016-04-22 | 1 | -1/+0 |
| | | |||||
* | | Sort member events | David Baker | 2016-04-22 | 1 | -0/+4 |
| | | | | | | | | So names of people in a room are given in order | ||||
* | | Implement group-of-people names | David Baker | 2016-04-22 | 1 | -17/+14 |
| | | |||||
* | | Flesh out email templating | David Baker | 2016-04-21 | 1 | -0/+142 |
|/ | | | | Mostly WIP porting the room name calculation logic from the web client so our room names in the email mirror the clients. | ||||
* | Create log context in Measure if one doesn't exist | Erik Johnston | 2016-04-18 | 1 | -6/+17 |
| | |||||
* | Use SynapseError 504 for Timeout errors | Erik Johnston | 2016-04-15 | 1 | -1/+2 |
| | |||||
* | Move the versionstring code out of app.homeserver into util | Mark Haines | 2016-04-11 | 2 | -0/+121 |
| | |||||
* | Remove some unused functions (#711) | Mark Haines | 2016-04-08 | 3 | -21/+0 |
| | | | | | | | | * Remove some unused functions * get_room_events_stream is only used in tests * is_exclusive_room might actually be something we want | ||||
* | Move all the wrapper functions for distributor.fire | Mark Haines | 2016-04-08 | 1 | -1/+21 |
| | | | | | | | Move the functions inside the distributor and import them where needed. This reduces duplication and makes it possible for flake8 to detect when the functions aren't used in a given file. | ||||
* | Rename things | Erik Johnston | 2016-04-07 | 1 | -5/+5 |
| | |||||
* | Log contexts and squash things together | Erik Johnston | 2016-04-07 | 1 | -17/+15 |
| | |||||
* | Add comment | Erik Johnston | 2016-04-07 | 1 | -0/+8 |
| | |||||
* | Deduplicate joins | Erik Johnston | 2016-04-07 | 2 | -1/+43 |
| | |||||
* | Make the cache objects be per instance rather than being global | Mark Haines | 2016-04-06 | 1 | -21/+24 |
| | |||||
* | Comment | Erik Johnston | 2016-04-01 | 1 | -1/+1 |
| | |||||
* | Add concurrently_execute function | Erik Johnston | 2016-04-01 | 1 | -1/+31 |
| | |||||
* | Fix typo | Mark Haines | 2016-03-24 | 1 | -1/+1 |
| | |||||
* | Deduplicate identical /sync requests | Mark Haines | 2016-03-24 | 1 | -0/+46 |
| | |||||
* | Simplify intern_dict | Erik Johnston | 2016-03-23 | 1 | -17/+10 |
| | |||||
* | Intern all the things | Erik Johnston | 2016-03-23 | 1 | -1/+57 |
| | |||||
* | String intern | Erik Johnston | 2016-03-23 | 1 | -0/+8 |
| | |||||
* | Make LruCache use a dedicated _Node class | Erik Johnston | 2016-03-22 | 1 | -32/+41 |
| | |||||
* | Return list, not generator. | Erik Johnston | 2016-03-14 | 1 | -3/+1 |
| | |||||
* | Use syntax that works on both py2.7 and py3 | Mark Haines | 2016-03-07 | 1 | -1/+1 |
| | |||||
* | Limit stream change cache size too | Erik Johnston | 2016-03-01 | 1 | -1/+5 |
| | |||||
* | Move cache size fiddling to descriptors only. Fix tests | Erik Johnston | 2016-03-01 | 1 | -2/+2 |
| | |||||
* | Add enviroment variable SYNAPSE_CACHE_FACTOR, default it to 0.1 | Erik Johnston | 2016-03-01 | 1 | -0/+6 |
| | |||||
* | Reraise exception | Erik Johnston | 2016-03-01 | 1 | -0/+1 |
| | |||||
* | Correct cache miss detection | Erik Johnston | 2016-03-01 | 1 | -1/+1 |
| | |||||
* | Report size of ExpiringCache | Erik Johnston | 2016-02-23 | 1 | -2/+13 |
| | |||||
* | Change the way we figure out presence updates for small deltas | Erik Johnston | 2016-02-23 | 1 | -0/+16 |
| | |||||
* | Add presence metrics | Erik Johnston | 2016-02-19 | 1 | -0/+6 |
| | |||||
* | WheelTimer: Don't scan list, use index. | Erik Johnston | 2016-02-18 | 1 | -5/+8 |
| | |||||
* | Initial cut | Erik Johnston | 2016-02-17 | 1 | -1/+1 |
| | |||||
* | Add wheeltimer impl | Erik Johnston | 2016-02-17 | 1 | -0/+88 |
| | |||||
* | Merge pull request #566 from matrix-org/erikj/logcontext | Erik Johnston | 2016-02-10 | 1 | -16/+13 |
|\ | | | | | Don't bother copying records on parent context | ||||
| * | Remove comment | Erik Johnston | 2016-02-10 | 1 | -1/+1 |
| | | |||||
| * | s/parent_context/previous_context/ | Erik Johnston | 2016-02-10 | 1 | -9/+9 |
| | | |||||
| * | Set parent context on instansiation | Erik Johnston | 2016-02-10 | 1 | -2/+7 |
| | | |||||
| * | Don't bother copying records on parent context | Erik Johnston | 2016-02-09 | 1 | -8/+0 |
| | | |||||
* | | Fix unit tests | Erik Johnston | 2016-02-09 | 1 | -4/+5 |
| | | |||||
* | | Don't create new logging context | Erik Johnston | 2016-02-09 | 1 | -12/+15 |
|/ | |||||
* | Fix bug in util.metrics.Measure | Erik Johnston | 2016-02-09 | 1 | -1/+3 |
| | |||||
* | Create new context when measuring | Erik Johnston | 2016-02-09 | 1 | -2/+5 |
| | |||||
* | Change logcontext warns to debug | Erik Johnston | 2016-02-09 | 1 | -3/+3 |
| | |||||
* | Fix up logcontexts | Erik Johnston | 2016-02-08 | 9 | -28/+169 |
| | |||||
* | Add metrics to pushers | Erik Johnston | 2016-02-08 | 1 | -0/+86 |
| | |||||
* | Allowing tagging log contexts | Erik Johnston | 2016-02-03 | 1 | -1/+6 |
| | |||||
* | Fix flake8 warnings for new flake8 | Daniel Wagner-Hall | 2016-02-02 | 6 | -7/+7 |
| | |||||
* | If stream pos is greater then earliest known key and entity hasn't changed, ↵ | Erik Johnston | 2016-01-29 | 1 | -8/+3 |
| | | | | then entity hasn't changed | ||||
* | Prefill stream change caches | Erik Johnston | 2016-01-29 | 1 | -1/+4 |
| | |||||
* | Merge pull request #536 from matrix-org/erikj/sync | Erik Johnston | 2016-01-29 | 1 | -0/+107 |
|\ | | | | | Make /sync "better". | ||||
| * | If the same as the earliest key, assume nothing has changed. | Erik Johnston | 2016-01-28 | 1 | -0/+5 |
| | | |||||
| * | Correctly update _entity_to_key | Erik Johnston | 2016-01-28 | 1 | -4/+5 |
| | | |||||
| * | Fix inequalities | Erik Johnston | 2016-01-28 | 1 | -2/+2 |
| | | |||||
| * | Include cache hits with has_entity_changed | Erik Johnston | 2016-01-28 | 1 | -0/+4 |
| | | |||||
| * | Change name and doc has_entity_changed | Erik Johnston | 2016-01-28 | 1 | -1/+3 |
| | | |||||
| * | Cache tags and account data | Erik Johnston | 2016-01-28 | 2 | -92/+95 |
| | | |||||
| * | Ensure keys to RoomStreamChangeCache are ints | Erik Johnston | 2016-01-28 | 1 | -0/+6 |
| | | |||||
| * | Invalidate caches properly. Remove unused arg | Erik Johnston | 2016-01-28 | 1 | -2/+2 |
| | | |||||
| * | Add cache to room stream | Erik Johnston | 2016-01-27 | 1 | -0/+86 |
| | | |||||
* | | Directly set self.value | Erik Johnston | 2016-01-29 | 1 | -1/+1 |
| | | |||||
* | | Remove spurious self.size | Erik Johnston | 2016-01-29 | 1 | -1/+0 |
| | | |||||
* | | Correctly bookkeep the size of TreeCache | Erik Johnston | 2016-01-29 | 1 | -3/+28 |
| | | |||||
* | | Make TreeCache keep track of its own size. | Erik Johnston | 2016-01-29 | 2 | -6/+10 |
| | | |||||
* | | Reset size on clear | Erik Johnston | 2016-01-29 | 1 | -0/+2 |
|/ | |||||
* | Don't add the member functiopn if we're not using treecache | David Baker | 2016-01-22 | 1 | -1/+4 |
| | |||||
* | docs | David Baker | 2016-01-22 | 1 | -1/+5 |
| | |||||
* | Revert all the bits changing keys of eeverything that used LRUCaches to tuples | David Baker | 2016-01-22 | 2 | -6/+6 |
| | |||||
* | Make LRU cache not default to treecache & add options to use it | David Baker | 2016-01-22 | 2 | -10/+19 |
| |