Closed
Bug 710832
Opened 13 years ago
Closed 13 years ago
move balrog transaction objects to a higher level
Categories
(Release Engineering :: General, defect)
Release Engineering
General
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: bhearsum, Assigned: bhearsum)
Details
Attachments
(1 file, 1 obsolete file)
45.18 KB,
patch
|
rail
:
review+
catlee
:
review+
bhearsum
:
checked-in+
|
Details | Diff | Splinter Review |
While working on bug 693593 I attempted to make a single request completely atomic - that is, if any of the queries performed in a method like auslib.web.views.releases.SingleLocaleView.put, that any changes already made in the same method should be reverted.
In the current design, where transaction objects are created and executed in the low level AUSTable methods, this isn't possible. When these were first added, they were put there on the assumption that transactions could be used to prevent update collisions. With that not being the case anymore, it doesn't make as much sense to keep them there.
Basically, doing this would require an AUSTransaction object to be passed to all of the non-readonly methods of Releases, Rules, Permissions, which would pass them along to AUSTable's insert/update/delete. These methods would add statements to the transaction, but never call .execute(), .commit(), or .rollback(). The web side of things would be on the hook for creating and managing the transaction objects, and therefore have the ability to rollback or commit as required.
Assignee | ||
Comment 1•13 years ago
|
||
This patch is large, but pretty simple. Here's the summary:
* All AUSTable (and subclass) methods that run queries now optionally take an AUSTransaction object.
* When present, select/insert/update/delete will add statements to it, and not commit the transaction. When not present, the old behaviour will be used (create a transaction and commit it before returning)
* Use an error handler to wrap uncaught exceptions in an HTTP 500 error
* Fix some assertEquals to be assertEqual, to be compatible with more Python versions
* Create a base class for admin views to factor out transaction creating/committing/aborting
* Import updates to retry.py
Attachment #588373 -
Flags: review?(rail)
Assignee | ||
Comment 2•13 years ago
|
||
Sorry, I just found some uncommitted changes in my working directory - just a small improvement to the logic in insert/delete/update, and a comment change.
Attachment #588373 -
Attachment is obsolete: true
Attachment #588373 -
Flags: review?(rail)
Attachment #588882 -
Flags: review?(rail)
Comment 3•13 years ago
|
||
Comment on attachment 588882 [details] [diff] [review]
small improvement to logic
Looks straight forward to me.
Attachment #588882 -
Flags: review?(rail) → review+
Assignee | ||
Updated•13 years ago
|
Attachment #588882 -
Flags: review?(catlee)
Comment 4•13 years ago
|
||
Comment on attachment 588882 [details] [diff] [review]
small improvement to logic
Review of attachment 588882 [details] [diff] [review]:
-----------------------------------------------------------------
::: auslib/db.py
@@ +331,5 @@
>
> @rtype: sqlalchemy.engine.base.ResultProxy
> """
> + row = self._returnRowOrRaise(where=where, transaction=trans)
> + log.debug("balhuteohuntoahuntheonuheo: %s", row)
indeed!
Attachment #588882 -
Flags: review?(catlee) → review+
Assignee | ||
Comment 5•13 years ago
|
||
Comment on attachment 588882 [details] [diff] [review]
small improvement to logic
https://github.com/mozilla/balrog/commit/c26b4bc70091fa26df8765c7f87adade17dd87bd
https://jenkins.mozilla.org/job/Balrog/51/
Attachment #588882 -
Flags: checked-in+
Assignee | ||
Updated•13 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Updated•11 years ago
|
Product: mozilla.org → Release Engineering
You need to log in
before you can comment on or make changes to this bug.
Description
•