HomePhabricator

AuthManager: Commit transaction after auto-creating a user

Authored by Anomie on Jul 12 2016, 5:35 PM.

Description

AuthManager: Commit transaction after auto-creating a user

As things stand now, DBO_TRX or DBO_DEFAULT will cause a transaction to
be started, and then anything in the entire request failing will
probably cause the newly-added user row to be lost. But updates to
external databases (e.g. CentralAuth) likely won't be since those DB
connections were probably shut down after the update was completed.

So let's explicitly commit changes af the end of auto-creation so that
problems with the request itself don't undo it.

Bug: T119736
Change-Id: I6c13c8feb86d8b9a01df894733c38445d048fea0