So, the issue turned out to be that postgres transactions were being held open in ubuntuone.oauth.store.fetch_access_token while we interacted with CouchDB, as part of processing the oauth_token_grant signal. This resulted in long-lived transactions which would conflict with others, producing TransactionRollbackErrors on the database side, and gateway timeouts on the proxy side.
So, the issue turned out to be that postgres transactions were being held open in ubuntuone. oauth.store. fetch_access_ token while we interacted with CouchDB, as part of processing the oauth_token_grant signal. This resulted in long-lived transactions which would conflict with others, producing TransactionRoll backErrors on the database side, and gateway timeouts on the proxy side.