https://bugzilla.wikimedia.org/show_bug.cgi?id=62091

            Bug ID: 62091
           Summary: MediaWiki:RestInPeace not called if exception thrown,
                    including ErrorPageError subclasses, resulting in db
                    writes being thrown away
           Product: MediaWiki
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: Database
          Assignee: wikibugs-l@lists.wikimedia.org
          Reporter: bawolff...@gmail.com
                CC: aschulz4...@gmail.com, sprin...@wikimedia.org
       Web browser: ---
   Mobile Platform: ---

I noticed I was getting "Notice: Uncommitted DB writes (transaction from
DatabaseBase::query (TranslatablePage::getTranslatablePages)). in
/var/www/w/git/includes/db/Database.php on line 4118" when viewing
Special:Preferences (locally) when not logged in.

Steps to reproduce:
*Have DBO_TRX or DBO_DEFAULT (assuming from web request) on. [This is default]
*Do some write query not currently in a transaction, so it gets an automatic
transaction
*Later on, throw an exception such as: throw new UserNotLoggedIn();

Expected behaviour:
*Automatic transaction gets committed at end of requestion (e.g.
MediaWiki::restInPeace() calls $factory->commitMasterChanges();).

Actual behaviour:
*Request ends without doing the load balancer shutdown stuff. As a result, the
current (implicit) transaction is lost.

The actual behaviour (throwing away the transaction) may make sense for normal
exceptions, but for error page exceptions I don't think it does, especially
when the transaction is implicit instead of explicit.

[Probably not a super problematic bug, since exception error pages tend to only
write caching related things to the db, if they write anything at all, but it
does seem incorrect behaviour with the potential for subtle bugs]

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to