forked-synapse/synapse/rest/client/v1
Kegan Dougal 2771447c29 Store Promise<Response> instead of Response for HTTP API transactions
This fixes a race whereby:
 - User hits an endpoint.
 - No cached transaction so executes main code.
 - User hits same endpoint.
 - No cache transaction so executes main code.
 - Main code finishes executing and caches response and returns.
 - Main code finishes executing and caches response and returns.

 This race is common in the wild when Synapse is struggling under load.
 This commit fixes the race by:
  - User hits an endpoint.
  - Caches the promise to execute the main code and executes main code.
  - User hits same endpoint.
  - Yields on the same promise as the first request.
  - Main code finishes executing and returns, unblocking both requests.
2016-11-10 14:49:26 +00:00
..
__init__.py copyrights 2016-01-07 04:26:29 +00:00
admin.py Dont invoke get_handlers fromClientV1RestServlet 2016-08-12 10:03:19 +01:00
base.py Store Promise<Response> instead of Response for HTTP API transactions 2016-11-10 14:49:26 +00:00
directory.py Dont invoke get_handlers fromClientV1RestServlet 2016-08-12 10:03:19 +01:00
events.py Make synchrotron accept /events 2016-08-12 15:31:44 +01:00
initial_sync.py Support /initialSync in synchrotron worker 2016-09-21 11:46:28 +01:00
login.py Conform better to the CAS protocol specification 2016-09-09 21:20:14 +01:00
logout.py Add helper function for getting access_tokens from requests 2016-09-09 16:33:15 +01:00
presence.py Move the presence handler out of the Handlers object 2016-05-16 18:56:37 +01:00
profile.py Dont invoke get_handlers fromClientV1RestServlet 2016-08-12 10:03:19 +01:00
push_rule.py Load push rules in storage layer, so that they get cached 2016-06-03 11:10:00 +01:00
pusher.py Working unsubscribe links going straight to the HS 2016-06-02 17:21:31 +01:00
register.py rest/client/v1/register: use the correct requester in createUser 2016-10-06 22:12:32 +02:00
room.py Store Promise<Response> instead of Response for HTTP API transactions 2016-11-10 14:49:26 +00:00
transactions.py Store Promise<Response> instead of Response for HTTP API transactions 2016-11-10 14:49:26 +00:00
voip.py Fix relative imports so they work in both py3 and py27 2016-03-08 11:45:50 +00:00