summary refs log tree commit diff
path: root/synapse/module_api (unfollow)
Commit message (Collapse)AuthorFilesLines
2018-01-19rewrite based on PR feedback:Matthew Hodgson7-89/+102
* [ ] 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
2018-01-19fix up v1, and improve errorsMatthew Hodgson4-20/+65
2018-01-19fix pep8Matthew Hodgson1-2/+1
2018-01-19mock registrations_require_3pidMatthew Hodgson1-0/+1
2018-01-19add registrations_require_3pidMatthew Hodgson5-13/+110
lets homeservers specify a whitelist for 3PIDs that users are allowed to associate with. Typically useful for stopping people from registering with non-work emails
2018-01-17Log room when doing state resolutionRichard van der Hoff1-0/+6
Mostly because it helps figure out what is prompting the resolution
2018-01-17fix SQL when searching all usersMatthew Hodgson1-2/+7
2018-01-17Split resolve_events into two functionsRichard van der Hoff2-20/+29
... so that the return type doesn't depend on the arg types
2018-01-17Remove lost commentErik Johnston1-3/+0
2018-01-17Sanity checking for user idsRichard van der Hoff2-8/+19
Check the user_id passed to a couple of APIs for validity, to avoid "IndexError: list index out of range" exception which looks scary and results in a 500 rather than a more useful error. Fixes #1432, among other things
2018-01-17Update last access time when thumbnails are viewedErik Johnston1-0/+2
2018-01-17Keep track of last access time for local mediaErik Johnston4-11/+65
2018-01-17Add docstringErik Johnston1-1/+1
2018-01-16Fix 'NoneType' object has no attribute 'writeHeaders'Richard van der Hoff1-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
2018-01-16Track DB scheduling delay per-requestRichard van der Hoff5-4/+43
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.
2018-01-16rework runInteraction in terms of runConnectionRichard van der Hoff1-20/+31
... so that we can share the code
2018-01-16fix typoMatthew Hodgson1-1/+1
2018-01-16Use local varsErik Johnston1-6/+2
2018-01-16Change _generate_thumbnails to take media_typeErik Johnston2-7/+10
2018-01-16Move setting of file_id up to callerErik Johnston2-13/+14
2018-01-16Track db txn time in millisecsRichard van der Hoff4-10/+17
... to reduce the amount of floating-point foo we do.
2018-01-16Optimise LoggingContext creation and copyingRichard van der Hoff3-22/+33
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.
2018-01-16Fix typoErik Johnston1-7/+10
2018-01-16Fix up log linesErik Johnston2-7/+10
2018-01-16document metrics changesRichard van der Hoff2-8/+58
2018-01-16Correctly use server_name/file_id when generating/fetching remote thumbnailsErik Johnston2-5/+8
2018-01-16Log when we respond with 404Erik Johnston2-1/+8
2018-01-16Fix a logcontext leak in persist_eventsRichard van der Hoff1-1/+8
ObserveableDeferred expects its callbacks to be called without any logcontexts, whereas it turns out we were calling them with the logcontext of the request which initiated the persistence loop. It seems wrong that we are attributing work done in the persistence loop to the request that happened to initiate it, so let's solve this by dropping the logcontext for it. (I'm not sure this actually causes any real problems other than messages in the debug log, but let's clean it up anyway)
2018-01-16Fix thumbnailing remote filesErik Johnston2-2/+30
2018-01-15Metrics for events processed in appservice and fed senderRichard van der Hoff2-0/+11
More metrics I wished I'd had
2018-01-15Metrics for number of RDATA commands receivedRichard van der Hoff1-5/+14
I found myself wishing we had this.
2018-01-15Reorganise request and block metricsRichard van der Hoff2-25/+84
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
2018-01-15mechanism to render metrics with alternative namesRichard van der Hoff1-13/+40
2018-01-15Add some comments to metrics classesRichard van der Hoff1-1/+27
2018-01-12Make Counter render floatsRichard van der Hoff1-3/+10
Prometheus handles all metrics as floats, and sometimes we store non-integer values in them (notably, durations in seconds), so let's render them as floats too. (Note that the standard client libraries also treat Counters as floats.)
2018-01-12Reinstate media download on thumbnail requestRichard van der Hoff1-0/+5
We need to actually download the remote media when we get a request for a thumbnail.
2018-01-12Fix up commentsErik Johnston2-7/+16
2018-01-12Correctly reraise exceptionErik Johnston1-2/+4
2018-01-12Make Responder a context managerErik Johnston2-9/+10
2018-01-12Add missing class varErik Johnston1-0/+3
2018-01-12Remove unnecessary conditionErik Johnston1-4/+1
2018-01-12Remove unused variablesErik Johnston1-3/+0
2018-01-12Make class var localErik Johnston1-3/+3
2018-01-12CommentsErik Johnston3-15/+65
2018-01-12Actually make it workErik Johnston2-2/+15
2018-01-12RefactorErik Johnston1-9/+4
2018-01-11When using synctl with workers, don't start the main synapse automaticallyErik Johnston2-8/+33
2018-01-10Do bcrypt hashing in a background threadErik Johnston3-10/+18
2018-01-10fix order of operations derp and also use `.get` to default to {}Michael Telatynski1-2/+3
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-01-10Fix publicised groups API (singular) over federationMichael Telatynski1-4/+4
which was missing its fed client API, since there is no other API it might as well reuse the bulk one and unwrap it Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-01-09Update http request metrics before calling servletRichard van der Hoff1-11/+19<