Some enlightenment would be nice on what (or better why) "DBUnexpectedError from line 2826 of ...\mw-master\includes\libs\rdbms\database\Database.php: AtomicSectionUpdate::doUpdate: Cannot COMMIT to clear snapshot because writes are pending" is raised to understand the limitations when using PHPDBG [0, 1] in connection with MW.
- What causes the "AtomicSectionUpdate::doUpdate: Cannot COMMIT..."?
- What actions can be taken to avoid "... Cannot COMMIT ..."?
- What does snapshot mean in the given context? The message of " ... Cannot COMMIT to clear snapshot .." seems a bit ambiguous.
Stack
Running with phpdbg on:
MediaWiki 1.28.0-alpha (84f96de)
PHP 7.0.2 (apache2handler)
MariaDB 10.1.9-MariaDB
> phpdbg -qrr ../../tests/phpunit/phpunit.php -c phpunit.xml.dist Using PHP 7.0.2 Semantic MediaWiki: 2.5.0-alpha (SMWSQLStore3, mysql) MediaWiki: 1.28.0-alpha (MediaWiki vendor autoloader) Site language: en Execution time: 2016-10-10 12:36 Xdebug: Disabled (or not installed) PHPUnit 4.8.24 by Sebastian Bergmann and contributors. Runtime: PHPDBG 7.0.2 Configuration: ...\mw-master\extensions\SemanticMediaWiki\phpunit.xml.dist ............................................................. 61 / 4106 ( 1%) ............................................................. 122 / 4106 ( 2%) .....................................
... CloneDatabase::cloneTableStructure duplicating user_properties to unittest_user_properties CloneDatabase::cloneTableStructure dropping unittest_valid_tag CloneDatabase::cloneTableStructure duplicating valid_tag to unittest_valid_tag CloneDatabase::cloneTableStructure dropping unittest_watchlist CloneDatabase::cloneTableStructure duplicating watchlist to unittest_watchlist [StashEdit] Empty cache for key 'mw-master:prepared-edit:1bfa43f59684425a7705634c29384f8c:298750bd1e455195c6391eb16753a726193d9470:90f42dc8c99187877261a42fd0a194b3' ('SMWUTDummyPage'); user '127.0.0.1'. [smw] Clear CachedPropertyValuesPrefetcher for SMWUTDummyPage#0# [objectcache] Rejected set() for mw-master:page-restrictions:1:1 due to pending writes. Title::getRestrictionTypes: applicable restrictions to [[SMWUTDummyPage]] are {edit,move} User::getBlockedStatus: checking... [objectcache] Rejected set() for mw-master:page-restrictions:1:1 due to pending writes. Title::getRestrictionTypes: applicable restrictions to [[SMWUTDummyPage]] are {edit,move} User::getBlockedStatus: checking... [exception] [31c616c417d0db24c5ad711b] [no req] DBUnexpectedError from line 2826 of ...\mw-master\includes\libs\rdbms\database\Database.php: AtomicSectionUpdate::doUpdate: Cannot COMMIT to clear snapshot because writes are pending (DatabaseMysqlBase::duplicateTableStructure, DatabaseMysqlBase::duplicateTableStructure, DatabaseMysqlBase::duplicateTableStructure, DatabaseMysqlBase::duplicateTableStructure, DatabaseMysqlBase::duplicateTableStructure, ... #0 ...\mw-master\includes\libs\rdbms\loadbalancer\LoadBalancer.php(1083): Database->flushSnapshot(string) #1 ...\mw-master\includes\libs\rdbms\loadbalancer\LoadBalancer.php(1381): LoadBalancer->{closure}(DatabaseMysqli) #2 ...\mw-master\includes\libs\rdbms\loadbalancer\LoadBalancer.php(1090): LoadBalancer->forEachOpenMasterConnection(Closure) #3 ...\mw-master\includes\libs\rdbms\lbfactory\LBFactory.php(177): LoadBalancer->beginMasterChanges(string) #4 ...\mw-master\includes\libs\rdbms\lbfactory\LBFactorySimple.php(145): LBFactory->{closure}(LoadBalancer, string, array) #5 ...\mw-master\includes\libs\rdbms\lbfactory\LBFactory.php(179): LBFactorySimple->forEachLB(Closure, array) #6 ...\mw-master\includes\libs\rdbms\lbfactory\LBFactory.php(201): LBFactory->forEachLBCallMethod(string, array) #7 ...\mw-master\includes\deferred\DeferredUpdates.php(246): LBFactory->beginMasterChanges(string) #8 ...\mw-master\includes\deferred\DeferredUpdates.php(209): DeferredUpdates::runUpdate(AtomicSectionUpdate, LBFactorySimple, integer) #9 ...\mw-master\includes\deferred\DeferredUpdates.php(121): DeferredUpdates::execute(array, string, integer)
PS: Running the tests on a "normal" PHP 7.0.11 with Xdebug 2.4.1 works just fine.
[0] http://phpdbg.com/docs
[1] https://thephp.cc/news/2015/08/phpunit-4-8-code-coverage-support