Closed
Bug 1303102
Opened 8 years ago
Closed 8 years ago
Use autocommit for the run_sql command
Categories
(Tree Management :: Treeherder, defect, P2)
Tree Management
Treeherder
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: emorley, Assigned: emorley)
References
Details
Attachments
(1 file)
Currently if there is a timeout during run_sql, any changes made to the current database will be thrown away, since COMMIT is triggered manually by run_sql (`conn.commit()`) after the (`cursor.execute(sql_code)`). This means that re-running run_sql repeatedly for an intensive change results in lots of busy-work but no changes saved (which has happened in bug 1303069). Instead if we just enabled autocommit, changes would be kept. People can always disable auto-commit within the provided SQL itself, using: SET AUTOCOMMIT=0 or START TRANSACTION ... COMMIT
Comment 1•8 years ago
|
||
Assignee | ||
Updated•8 years ago
|
Attachment #8791699 -
Flags: review?(james)
Updated•8 years ago
|
Attachment #8791699 -
Flags: review?(james) → review+
Comment 2•8 years ago
|
||
Commit pushed to master at https://github.com/mozilla/treeherder https://github.com/mozilla/treeherder/commit/c8802ef7ef6f0f3b91c66db9f5fe0edf0ed8498f Bug 1303102 - Use autocommit for the run_sql command This prevents changes from being discarded if the DB connection timed out between the `.execute()` call being made, and it completing.
Assignee | ||
Updated•8 years ago
|
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•