Commit message (Collapse) | Author | Files | Lines | ||
---|---|---|---|---|---|
2018-05-10 | Set Server header in SynapseRequest | Richard van der Hoff | 23 | -27/+28 | |
(instead of everywhere that writes a response. Or rather, the subset of places which write responses where we haven't forgotten it). This also means that we don't have to have the mysterious version_string attribute in anything with a request handler. Unfortunately it does mean that we have to pass the version string wherever we instantiate a SynapseSite, which has been c&ped 150 times, but that is code that ought to be cleaned up anyway really. | |||||
2018-05-10 | Remove redundant request_handler decorator | Richard van der Hoff | 7 | -38/+42 | |
This is needless complexity; we might as well use the wrapper directly. Also rename wrap_request_handler->wrap_json_request_handler. | |||||
2018-05-10 | Factor wrap_request_handler_with_logging out of wrap_request_handler | Richard van der Hoff | 1 | -54/+66 | |
... so that it can be used on non-JSON endpoints | |||||
2018-05-10 | Remove include_metrics param | Richard van der Hoff | 1 | -17/+7 | |
The metrics are now available via the request, so this is redundant and can go away at last. | |||||
2018-05-10 | Move outgoing_responses_counter handling to RequestMetrics | Richard van der Hoff | 2 | -4/+2 | |
it's much neater there. | |||||
2018-05-10 | Bump requests_counter in wrapped_request_handler | Richard van der Hoff | 1 | -4/+11 | |
less magic | |||||
2018-05-10 | Move RequestMetrics handling into SynapseRequest.processing() | Richard van der Hoff | 2 | -24/+64 | |
It fits quite nicely here, and opens the path to getting rid of the "include_metrics" mess. | |||||
2018-05-10 | Make RequestMetrics take a raw time rather than a clock | Richard van der Hoff | 2 | -6/+6 | |
... which is going to make it easier to move around. | |||||
2018-05-10 | Move request_id management into SynapseRequest | Richard van der Hoff | 2 | -15/+25 | |
2018-05-09 | Move RequestsMetrics to its own file | Richard van der Hoff | 2 | -124/+151 | |
This is useful in its own right, because server.py is full of stuff; but more importantly, I want to do some refactoring that will cause a circular reference as it is. | |||||
2018-05-09 | Add comment to sync as to why code path is split | Erik Johnston | 1 | -0/+5 | |
2018-05-09 | Fix returned token is no longer a tuple | Erik Johnston | 1 | -1/+1 | |
2018-05-09 | Fix up comment | Erik Johnston | 1 | -1/+1 | |
2018-05-09 | Update comments | Erik Johnston | 1 | -5/+6 | |
2018-05-09 | Remove unused code path from member change DB func | Erik Johnston | 1 | -24/+10 | |
The function is never called without a from_key, so we can remove all the handling for that scenario. | |||||
2018-05-09 | Refactor sync APIs to reuse pagination API | Erik Johnston | 2 | -44/+48 | |
The sync API often returns events in a topological rather than stream ordering, e.g. when the user joined the room or on initial sync. When this happens we can reuse existing pagination storage functions. | |||||
2018-05-09 | Don't unnecessarily require token to be stream token | Erik Johnston | 1 | -1/+1 | |
This allows calling the `get_recent_event_ids_for_room` function in more situations. | |||||
2018-05-09 | Refactor get_recent_events_for_room return type | Erik Johnston | 3 | -7/+21 | |
There is no reason to return a tuple of tokens when the last token is always the token passed as an argument. Changing it makes it consistent with other storage APIs | |||||
2018-05-09 | Refactor pagination DB API to return concrete type | Erik Johnston | 1 | -28/+48 | |
This makes it easier to document what is being returned by the storage functions and what some functions expect as arguments. | |||||
2018-05-09 | Remove unused from_token param | Erik Johnston | 1 | -7/+4 | |
2018-05-09 | Refactor recent events func to use pagination func | Erik Johnston | 1 | -48/+27 | |
This also removes a cache that is unlikely to ever get hit. | |||||
2018-05-09 | Fix up comments and make function private | Erik Johnston | 1 | -7/+7 | |
2018-05-09 | nuke-room-from-db.sh: nuke from table event_search too | rubo77 | 1 | -0/+1 | |
2018-05-09 | Dont nuke non-existing table event_search_content | rubo77 | 1 | -1/+0 | |
2018-05-09 | nuke-room-from-db.sh: added postgresql option and help | rubo77 | 1 | -1/+11 | |
2018-05-08 | Reuse existing pagination code for context API | Erik Johnston | 1 | -75/+15 | |
2018-05-08 | Parse tokens before calling DB function | Erik Johnston | 1 | -14/+18 | |
2018-05-08 | Only fetch required fields from database | Erik Johnston | 1 | -1/+2 | |
2018-05-08 | Split paginate_room_events storage function | Erik Johnston | 1 | -28/+72 | |
2018-05-05 | notifications: Convert next_token to string according to the spec | Konstantinos Sideris | 1 | -1/+1 | |
Currently the parameter is serialized as an integer. Signed-off-by: Konstantinos Sideris <sideris.konstantin@gmail.com> | |||||
2018-05-04 | Add Docker packaging in the author list | kaiyou | 1 | -0/+3 | |
2018-05-03 | Note that label values can be anything | Erik Johnston | 1 | -1/+2 | |
2018-05-03 | Fix metrics that have integer value labels | Erik Johnston | 1 | -1/+1 | |
2018-05-03 | Fix logcontext leaks in rate limiter | Richard van der Hoff | 1 | -3/+14 | |
2018-05-03 | Don't abortConnection() if the transport connection has already closed. | Will Hunt | 1 | -3/+8 | |
2018-05-03 | Fix changes warning | Richard van der Hoff | 1 | -2/+2 | |
2018-05-03 | Warn of potential client incompatibility from #3161 | Richard van der Hoff | 1 | -0/+15 | |
2018-05-03 | Fix up grammar | Erik Johnston | 1 | -3/+3 | |
2018-05-02 | add missing param to cancelled_to_request_timed_out_error | Richard van der Hoff | 1 | -1/+1 | |
This gets two arguments, not one. | |||||
2018-05-02 | Make _escape_character take MatchObject | Erik Johnston | 1 | -2/+10 | |
2018-05-02 | Escape label values in prometheus metrics | Erik Johnston | 2 | -3/+40 | |
2018-05-02 | Fix logcontext leak in media repo | Richard van der Hoff | 2 | -1/+4 | |
Make FileResponder.write_to_consumer uphold the logcontext contract | |||||
2018-05-02 | Remove spurious unittest.DEBUG | Richard van der Hoff | 1 | -1/+0 | |
2018-05-02 | Fix a couple of logcontext leaks in unit tests | Richard van der Hoff | 2 | -3/+9 | |
... which were making other, innocent, tests, fail. Plus remove a spurious unittest.DEBUG which was making the output noisy. | |||||
2018-05-02 | Fix a class of logcontext leaks | Richard van der Hoff | 2 | -33/+94 | |
So, it turns out that if you have a first `Deferred` `D1`, you can add a callback which returns another `Deferred` `D2`, and `D2` must then complete before any further callbacks on `D1` will execute (and later callbacks on `D1` get the *result* of `D2` rather than `D2` itself). So, `D1` might have `called=True` (as in, it has started running its callbacks), but any new callbacks added to `D1` won't get run until `D2` completes - so if you `yield D1` in an `inlineCallbacks` function, your `yield` will 'block'. In conclusion: some of our assumptions in `logcontext` were invalid. We need to make sure that we don't optimise out the logcontext juggling when this situation happens. Fortunately, it is easy to detect by checking `D1.paused`. | |||||
2018-05-02 | Fix incorrect reference to StringIO | Richard van der Hoff | 2 | -1/+39 | |
This was introduced in 4f2f5171 | |||||
2018-05-01 | Make the logging level configurable | kaiyou | 2 | -3/+4 | |
2018-05-01 | Fix the documentation about 'POSTGRES_DB' | kaiyou | 1 | -1/+1 | |
2018-05-01 | missing word :| | Matthew Hodgson | 1 | -1/+1 | |
2018-05-01 | missing word :| | Matthew Hodgson | 1 | -1/+1 | |
2018-05-01 | fix markdown | Matthew Hodgson | 1 | -3/+3 | |
2018-05-01 | changelog for 0.28.1 v0.28.1 | Matthew Hodgson | 1 | -2/+23 | |
2018-05-01 | Update __init__.py | Neil Johnson | 1 | -1/+1 | |
bump version | |||||
2018-05-01 | Miscellaneous fixes to python_dependencies | Richard van der Hoff | 1 | -1/+19 | |
* add some doc about wtf this thing does * pin Twisted to < 18.4 * add explicit dep on six (fixes #3089) | |||||
2018-05-01 | Apply some limits to depth to counter abuse | Richard van der Hoff | 3 | -4/+26 | |
* When creating a new event, cap its depth to 2^63 - 1 * When receiving events, reject any without a sensible depth As per https://docs.google.com/document/d/1I3fi2S-XnpO45qrpCsowZv8P8dHcNZ4fsBsbOW7KABI | |||||
2018-05-01 | remove user agent from data model, will just join on user_ips | Neil Johnson | 1 | -12/+11 | |
2018-05-01 | add inidexes based on usage | Neil Johnson | 1 | -6/+2 | |
2018-05-01 | 10 mins seems more reasonable that every minute | Neil Johnson | 1 | -1/+1 | |
2018-04-30 | Burminate v1auth | Adrian Tschira | 7 | -25/+24 | |
This closes #2602 v1auth was created to account for the differences in status code between the v1 and v2_alpha revisions of the protocol (401 vs 403 for invalid tokens). However since those protocols were merged, this makes the r0 version/endpoint internally inconsistent, and violates the specification for the r0 endpoint. This might break clients that rely on this inconsistency with the specification. This is said to affect the legacy angular reference client. However, I feel that restoring parity with the spec is more important. Either way, it is critical to inform developers about this change, in case they rely on the illegal behaviour. Signed-off-by: Adrian Tschira <nota@notafile.com> | |||||
2018-04-30 | Fixes #3135 - Replace _OpenSSLECCurve with crypto.get_elliptic_curve (#3157) | Will Hunt | 2 | -8/+8 | |
fixes #3135 Signed-off-by: Will Hunt will@half-shot.uk | |||||
2018-04-30 | add guard for None on purge_history api | Krombel | 1 | -1/+14 | |
2018-04-30 | run config tests on py3 | Adrian Tschira | 1 | -1/+2 | |
Signed-off-by: Adrian Tschira <nota@notafile.com> | |||||
2018-04-30 | add comment explaining attributeerror | Adrian Tschira | 1 | -0/+3 | |
2018-04-30 | add py36 to build matrix | Richard van der Hoff | 1 | -5/+13 | |
2018-04-30 | Remove redundant call to preserve_fn | Richard van der Hoff | 1 | -4/+2 | |
submit_event_for_as doesn't return a deferred anyway, so this is pointless. | |||||
2018-04-30 | Update tox.ini | Richard van der Hoff | 1 | -1/+1 | |
add missing comma | |||||
2018-04-29 | Construct HMAC as bytes on py3 | Adrian Tschira | 2 | -11/+15 | |
Signed-off-by: Adrian Tschira <nota@notafile.com> | |||||
2018-04-29 | more bytes strings | Adrian Tschira | 4 | -7/+10 | |
Signed-off-by: Adrian Tschira <nota@notafile.com> | |||||
2018-04-28 | fix missing import | Matthew Hodgson | 1 | -0/+1 | |
2018-04-28 | pep8 | Matthew Hodgson | 1 | -3/+5 | |
2018-04-28 | make it work with sqlite | Matthew Hodgson | 2 | -34/+54 | |
2018-04-28 | Move more xrange to six | Adrian Tschira | 9 | -11/+28 | |
plus a bonus next() Signed-off-by: Adrian Tschira <nota@notafile.com> | |||||
2018-04-28 | replace stringIO imports | Adrian Tschira | 2 | -3/+3 | |
2018-04-28 | move httplib import to six | Adrian Tschira | 1 | -3/+3 | |
2018-04-28 | make imports local | Adrian Tschira | 4 | -7/+7 | |
Signed-off-by: Adrian Tschira <nota@notafile.com> | |||||
2018-04-28 | Don't yield in list comprehensions | Adrian Tschira | 1 | -5/+9 | |
I've tried to grep for more of this with no success. Signed-off-by: Adrian Tschira <nota@notafile.com> | |||||
2018-04-28 | open log_config in text mode too | Adrian Tschira | 1 | -1/+1 | |
Signed-off-by: Adrian Tschira <nota@notafile.com> | |||||
2018-04-27 | Add py3 tests to tox with folders that work | Adrian Tschira | 1 | -1/+9 | |
It's just a few tests, but it will at least prevent a few files from regressing. Also, it makes it easiert to check your code against py36 while writing it. Signed-off-by: Adrian Tschira <nota@notafile.com> | |||||
2018-04-27 | pep8; remove spurious import | Richard van der Hoff | 1 | -1/+1 | |
2018-04-27 | Use run_in_background in preference to preserve_fn | Richard van der Hoff | 22 | -71/+97 | |
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. | |||||
2018-04-27 | Backport deferred.addTimeout | Richard van der Hoff | 5 | -14/+90 | |
Twisted 16.0 doesn't have addTimeout, so let's backport it. | |||||
2018-04-27 | Trap exceptions thrown within run_in_background | Richard van der Hoff | 1 | -1/+7 | |
Turn any exceptions that get thrown synchronously within run_in_background into Failures instead. | |||||
2018-04-27 | Update CHANGES.rst | Neil Johnson | 1 | -1/+1 | |
2018-04-27 | Update CHANGES.rst | Neil Johnson | 1 | -1/+1 | |
2018-04-27 | reraise exceptions more carefully | Richard van der Hoff | 2 | -13/+24 | |
We need to be careful (under python 2, at least) that when we reraise an exception after doing some error handling, we actually reraise the original exception rather than anything that might have been raised (and handled) during the error handling. | |||||
2018-04-27 | Refactor event storage to not require state | Erik Johnston | 1 | -37/+67 | |
This is in preparation for using contexts that may or may not have the current_state_ids set. This will allow us to avoid unnecessarily pulling out state for an event on the master process when using workers. We also add a check to see if the state groups of the old extremities are the same as the new ones. | |||||
2018-04-27 | Add missing consumeErrors | Richard van der Hoff | 3 | -5/+9 | |
In general we want defer.gatherResults to consumeErrors, rather than having exceptions hanging around and getting logged as CRITICAL unhandled errors. | |||||
2018-04-27 | Improve exception handling for background processes | Richard van der Hoff | 20 | -237/+335 | |
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. | |||||
2018-04-27 | also upgrade pip when installing | Richard van der Hoff | 1 | -0/+4 | |
2018-04-26 | update changelog and bump version to 0.28.0 |