summary refs log tree commit diff
path: root/synapse/http/server.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Add Cache-Control headers to all JSON APIsErik Johnston2018-03-211-0/+1
| | | | | | | | | | | | It is especially important that sync requests don't get cached, as if a sync returns the same token given then the client will call sync with the same parameters again. If the previous response was cached it will get reused, resulting in the client tight looping making the same request and never making any progress. In general, clients will expect to get up to date data when requesting APIs, and so its safer to do a blanket no cache policy than only whitelisting APIs that we know will break things if they get cached.
* Merge branch 'master' of github.com:matrix-org/synapse into developErik Johnston2018-03-191-2/+0
|\
| * Replace ujson with simplejsonErik Johnston2018-03-151-3/+2
| |
* | Replace some ujson with simplejson to make it workErik Johnston2018-03-161-1/+2
| |
* | Add some docstrings to help figure this outRichard van der Hoff2018-03-091-2/+26
| |
* | Add a metric which increments when a request is receivedRichard van der Hoff2018-03-091-2/+10
| | | | | | | | | | | | It's useful to know when there are peaks in incoming requests - which isn't quite the same as there being peaks in outgoing responses, due to the time taken to handle requests.
* | refactor JsonResourceRichard van der Hoff2018-03-091-32/+46
| | | | | | | | | | rephrase the OPTIONS and unrecognised request handling so that they look similar to the common flow.
* | Merge remote-tracking branch 'origin/develop' into rav/track_db_schedulingRichard van der Hoff2018-01-171-9/+9
|\ \
| * \ Merge pull request #2793 from matrix-org/rav/db_txn_time_in_millisRichard van der Hoff2018-01-171-1/+3
| |\ \ | | | | | | | | Track db txn time in millisecs
| * | | Fix 'NoneType' object has no attribute 'writeHeaders'Richard van der Hoff2018-01-161-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid throwing a (harmless) exception when we try to write an error response to an http request where the client has disconnected. This comes up as a CRITICAL error in the logs which tends to mislead people into thinking there's an actual problem
* | | | Track DB scheduling delay per-requestRichard van der Hoff2018-01-161-0/+7
| |/ / |/| | | | | | | | | | | | | | 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 millisecsRichard van der Hoff2018-01-161-1/+3
|/ / | | | | | | ... to reduce the amount of floating-point foo we do.
* | Reorganise request and block metricsRichard van der Hoff2018-01-151-14/+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
* | Update http request metrics before calling servletRichard van der Hoff2018-01-091-11/+19
|/ | | | | Make sure that we set the servlet name in the metrics object *before* calling the servlet, in case the servlet throws an exception.
* Improve tracebacks on exceptionsRichard van der Hoff2017-11-271-3/+9
| | | | | Use failure.Failure to recover our failure, which will give us a useful stacktrace, unlike the rethrown exception.
* replace 'except:' with 'except Exception:'Richard van der Hoff2017-10-231-1/+1
| | | | what could possibly go wrong
* Initial group server implementationErik Johnston2017-07-101-1/+3
|
* allow Authorization header which handling got implemented in #1098Krombel2017-06-161-1/+1
| | | | Signed-off-by: Matthias Kesler <krombel@krombel.de>
* Set CORs headers on responses from the media repoMark Haines2016-11-021-5/+18
|
* Add exception logging. Fix typoErik Johnston2016-08-221-3/+3
|
* Allow request handlers to override metric nameErik Johnston2016-08-221-21/+31
|
* Use top level measureErik Johnston2016-08-221-15/+1
|
* Add a top level measureErik Johnston2016-08-191-45/+46
|
* Remove redundant measureErik Johnston2016-08-191-35/+34
|
* Measure http.server renderErik Johnston2016-08-191-28/+30
|
* Log when adding listenersRichard van der Hoff2016-07-251-0/+1
|
* Fix more typos in per-request metricsMark Haines2016-04-281-4/+5
|
* Fix typo in request metricsMark Haines2016-04-281-1/+1
|
* Add a comment explaining why automatic metric reporting is disabled for ↵Mark Haines2016-04-281-0/+4
| | | | JsonResource
* Check if report_metrics is TrueMark Haines2016-04-281-3/+4
|
* Report per request metrics for all of the things using request_handlerMark Haines2016-04-281-38/+63
|
* Intern all the thingsErik Johnston2016-03-231-4/+6
|
* Catch the exceptions thrown by twisted when you write to a closed connectionMark Haines2016-02-121-1/+20
|
* Fix up logcontextsErik Johnston2016-02-081-3/+2
|
* Add metrics to pushersErik Johnston2016-02-081-0/+10
|
* Allowing tagging log contextsErik Johnston2016-02-031-15/+26
|
* copyrightsMatthew Hodgson2016-01-071-1/+1
|
* Fix typoDaniel Wagner-Hall2015-12-161-1/+1
|
* Include errcode on Internal Server ErrorDaniel Wagner-Hall2015-12-141-2/+5
|
* Track the time spent in the database per request.Mark Haines2015-12-071-0/+15
| | | | and track the number of transactions that request started.
* Add metrics to track the cpu on the main thread consumed by each type of requestMark Haines2015-12-041-0/+17
|
* Host /unstable and /r0 versions of r0 APIsDaniel Wagner-Hall2015-12-011-6/+7
|
* Remove syutil dependency in favour of smaller single-purpose librariesMark Haines2015-08-241-6/+6
|
* Don't 500 if a group is missing from the regexMark Haines2015-07-061-1/+1
|
* Disable twisted access logging. Move access logging to SynapseRequest objectErik Johnston2015-06-151-58/+32
|
* Log more when we have processed the requestErik Johnston2015-06-151-2/+12
|
* Create SynapseRequest that overrides __repr__ to not print access_tokenErik Johnston2015-06-151-11/+3
|
* Make http.server request logging more verbose, but redact access_tokensErik Johnston2015-06-151-2/+12
|
* Remove log lineErik Johnston2015-05-291-1/+0
|
* Add config option to turn off freezing events. Use new encode_json api and ↵Erik Johnston2015-05-291-4/+13
| | | | ujson.loads
* Fix up leak. Add warnings.Erik Johnston2015-05-081-2/+4
|
* Unused importDavid Baker2015-04-301-1/+1
|
* Doesn't look like this is used anymoreDavid Baker2015-04-301-13/+0
|
* Merge branch 'develop' into csauthDavid Baker2015-04-241-97/+124
|\ | | | | | | | | Conflicts: synapse/http/server.py
| * Combine the request wrappers in rest/media/v1 and http/server into a single ↵Mark Haines2015-04-211-3/+12
| | | | | | | | wrapper decorator
| * Split out the JsonResource request logging and error handling into a ↵Mark Haines2015-04-211-94/+113
| | | | | | | | separate wrapper function
* | Explain how I justified to myself making JsonResource not always send JSON.David Baker2015-04-011-0/+7
| |
* | Completely replace fallback auth for C/S V2:David Baker2015-04-011-2/+5
| | | | | | | | | | | | | | * Now only the auth part goes to fallback, not the whole operation * Auth fallback is a normal API endpoint, not a static page * Params like the recaptcha pubkey can just live in the config Involves a little engineering on JsonResource so its servlets aren't always forced to return JSON. I should document this more, in fact I'll do that now.
* | Make docs a bit more trueDavid Baker2015-03-311-1/+1
| |
* | Grammar and deduplicationDavid Baker2015-03-311-5/+4
|/
* Add a DistributionMetric to HTTP request/response processing time in the serverPaul "LeoNerd" Evans2015-03-161-0/+9
|
* actually uphold the bind_host parameter. in theory should make ipv6 binds ↵Matthew Hodgson2015-03-141-1/+6
| | | | work like bind_host: 'fe80::1%lo0'
* Appease pep8Paul "LeoNerd" Evans2015-03-121-3/+5
|
* Count incoming HTTP requests per servlet that respondsPaul "LeoNerd" Evans2015-03-121-7/+11
|
* Use _ instead of . as a metric namespacing separator, for PrometheusPaul "LeoNerd" Evans2015-03-121-2/+2
|
* Rename Metrics' "keys" to "labels"Paul "LeoNerd" Evans2015-03-121-2/+2
|
* Add vector counters to HTTP clients and servers; count the requests by ↵Paul "LeoNerd" Evans2015-03-121-0/+14
| | | | method and responses by method and response code
* Slightly reduce the insane amounts of indentation in main http server ↵Paul "LeoNerd" Evans2015-03-051-21/+23
| | | | response path, by 'continue'ing around a non-match or falling through
* Use git aware version string in User-Agent and Server headersErik Johnston2015-02-181-9/+18
|
* Fix bug where variable was not always definedErik Johnston2015-02-111-2/+1
|
* Log when we receive a request, when we send a response and how long it took ↵Erik Johnston2015-02-091-2/+21
| | | | to process it.
* Oops: second part of commit dc938606David Baker2015-01-221-6/+2
|
* Update copyright noticesMark Haines2015-01-061-2/+2
|
* Set a content-length for JSON responsesMark Haines2015-01-061-0/+1
|
* Include version in User-Agent and Server headersMark Haines2014-12-221-3/+6
|
* Fix tests and remove debug loggingErik Johnston2014-12-121-4/+0
|
* Consistently url decode and decode as utf 8 the URL partsErik Johnston2014-12-121-1/+11
|
* Get uploads working with new media repoMark Haines2014-12-021-2/+2
|
* Write the upload portion of version 1 of the media repositoryMark Haines2014-12-021-7/+14
|
* Fix pep8 codestyle warningsMark Haines2014-11-201-2/+1
|
* Use module loggers rather than the root logger. Exceptions caused by bad ↵Mark Haines2014-11-201-1/+1
| | | | clients shouldn't cause ERROR level logging. Fix sql logging to use 'repr' rather than 'str'
* Add a request-id to each log lineMark Haines2014-10-301-1/+12
|
* fix the copyright holder from matrix.org to OpenMarket Ltd, as matrix.org ↵Matthew Hodgson2014-09-031-1/+1
| | | | hasn't been incorporated in time for launch.
* move contentrepo class to it's own fileMark Haines2014-09-031-162/+1
|
* Set status message for ratelimit error responsesMark Haines2014-09-031-5/+9
|
* given everything's apparently gone https:// by default for c-s, change this ↵Matthew Hodgson2014-09-011-1/+5
| | | | hardcoding...
* missed a s#/matrix#/_matrix/gMatthew Hodgson2014-08-311-1/+1
|
* For the content repo, don't just use homeserver.hostname as that might not ↵Erik Johnston2014-08-241-1/+3
| | | | include the port due to SRV.
* Make the content repo work with in daemon mode. Return the full url on ↵Erik Johnston2014-08-221-6/+20
| | | | upload. Update the webclient to use new content repo api.
* Reduce the amount of incredibly spammy stack traces. Expected errors (e.g. ↵Kegan Dougal2014-08-191-1/+13
| | | | SynapseErrors) shouldn't have their full trace logged every time. Don't send responses to disconnected requests.
* Small amounts of cleanup and bonus round comments.Kegan Dougal2014-08-181-4/+8
|
* Implemented GETs for the ContentRepoResource. It all actually appears to be ↵Kegan Dougal2014-08-181-11/+60
| | | | working.
* hs: Make the uploads directory if it doesn't exist. Namespace uploads by the ↵Kegan Dougal2014-08-181-5/+46
| | | | base64 encoded user id of the uploader. Make a reasonable attempt to retry clashing upload paths. Try to guess a sensible file extension depending on the content type.
* Auth content uploads. Added a mapping function from request > filename. ↵Kegan Dougal2014-08-181-12/+32
| | | | Added exception handling for content uploads. webclient: Only prefix the client API path on doRequest, not doBaseRequest (this would've broken the identity server auth too). Added matrixService.uploadContent. May not require mFileUpload anymore.
* Added /matrix/content path, HS resource_for_content_repo attribute and ↵Kegan Dougal2014-08-181-0/+28
| | | | FileUploadResource. Added stub methods.
* If the web client is enabled, automatically redirect root '/' to the web ↵Kegan Dougal2014-08-141-0/+17
| | | | client path.
* Removed http_server from HomeServer. Updated unit tests to use either ↵Kegan Dougal2014-08-141-9/+3
| | | | resource_for_federation or resource_for_client depending on what is being tested.
* Start phasing out HttpServer: we should be using Resources instead. Added ↵Kegan Dougal2014-08-141-0/+5
| | | | resource_for_client/federation/web_client to the HomeServer and hooked the C-S servlets to operate on resource_for_client. Dynamically construct the Resource tree.
* add in whitespace after copyright statements to improve legibilityMatthew Hodgson2014-08-131-0/+1
|
* Just say yes to OPTIONS requests, since we want to turn on CORS headers for ↵Erik Johnston2014-08-121-0/+5
| | | | all paths
* Reference Matrix Home Servermatrix.org2014-08-121-0/+181