Actions
Bug #13593
closed[API] Sequence of "create group" requests runs slowly, and can crash API server
Status:
Resolved
Priority:
Normal
Assigned To:
Category:
-
Target version:
Start date:
03/12/2019
Due date:
% Done:
100%
Estimated time:
(Total: 0.00 h)
Story points:
3.0
Release:
Release relationship:
Auto
Description
A user reported that creating many projects at once resulted in extreme slowdown and eventually crashing the API server unless the create requests were throttled.
Creating a project (or any other group) also refreshes the permissions graph in the same transaction.
This makes the API call slow, but we intend/expect that other API calls can proceed while the update is in progress, so other (non-permission-modifying) API calls aren't expected to be slowed down.
The approach would be:
- Accept an
async
param to permission-changing calls that would delay the permission graph update for a server configurable number of seconds in the future. - When updating the permission graph asynchronously, use the
CONCURRENTLY
parameter to avoid blockingSELECT
while it’s being updated. (PostgreSQL 9.4 feature, check API server’s dependency requirements). - Use status 202 (Accepted) on async call responses.
- Make a performance analysis comparison to make sure the issue is solved.
- Update documentation.
Actions