db layer test resets interact badly with slave appserver instances
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Triaged
|
High
|
Unassigned |
Bug Description
External appservers like those started by ZopelessAppserv
If there are two tests in the layer, and one of them triggers a db reset (e.g. by doing a commit() rather than a rollback where we can just reset the db sequences), then the slave appserver is forcibly disconnected from the database (as is the librarian and other helpers).
Subsequent requests to the appserver will trigger oopses (which will retry so the thing -works- but we have an oops logged. And, because the next requestor is the next test, that test will see 'spurious' oopses if and only if it is run directly after a test that caused the testdb to be dropped (by committing).
Note that it is entirely appropriate for the test appserver to raise OOPSes - in production we care a great deal about noticing such events.
oops-3: {{{
Oops-Id: OOPS-ec2ee8085482c92c96e7e288cb8ca88e
Exception-Type: AssertionError
Exception-Value: Bug #504291: Store left in a disconnected state.
Date: 2011-10-
Page-Id:
Branch: useoops
Revision: 14111
User: unauthenticated, Anonymous, Anonymous, Anonymous User
URL: http://
Duration: -1
Oops-Reporter: T
CHANNEL_
CONTENT_LENGTH=286
CONTENT_
GATEWAY_
HTTP_HOST=
HTTP_USER_
PATH_INFO=
REMOTE_
REQUEST_METHOD=POST
SCRIPT_NAME=
SERVER_
SERVER_PORT=8087
SERVER_
SERVER_
wsgi.input=
xmlrpc args=%5B%
zc.zservertrace
Traceback (most recent call last):
Module canonical.
"Bug #504291: Store left in a disconnected state.")
AssertionError: Bug #504291: Store left in a disconnected state.
}}}
(there are also oopses like 31T00:30: 10.114000+ 00:00 launchpad. dev:8085
oops-4: {{{
Oops-Id: OOPS-a1fd7ae1c2a945a8867824c5e636b891
Exception-Type: DisconnectionError
Exception-Value: terminating connection due to administrator command server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request.
Date: 2011-10-
Page-Id:
Branch: useoops
Revision: 14111
User: unauthenticated, Anonymous, Anonymous, Anonymous User
URL: http://
Duration: 0.00250387191772
Oops-Reporter: T
CHANNEL_ CREATION_ TIME=1320021010 .11 TYPE=text/ xml INTERFACE= CGI/1.1 xmlrpc- private. launchpad. dev:8087 AGENT=xmlrpclib .py/1.0. 1 (by www.pythonware.com) /codehosting ADDR=127. 0.0.1 NAME=lucid- test-lp PROTOCOL= HTTP/1. 0 SOFTWARE= zope.server. http (PrivateXMLRPC) %3Chidden% 3E 27+launchpad- services% 27, %27//%7Eperson- name-425389/ .bzr/branch- format% 27%5D log.interfaces. ITraceLog= %3Chidden% 3E
CONTENT_LENGTH=266
CONTENT_
GATEWAY_
HTTP_HOST=
HTTP_USER_
PATH_INFO=
REMOTE_
REQUEST_METHOD=POST
SCRIPT_NAME=
SERVER_
SERVER_PORT=8087
SERVER_
SERVER_
wsgi.input=
xmlrpc args=%5B%
zc.zservertrace
00000-00000@ SQL-main- master SELECT FeatureFlag. date_modified, FeatureFlag.flag, FeatureFlag. priority, FeatureFlag.scope, FeatureFlag."value" FROM FeatureFlag ORDER BY FeatureFlag.flag, FeatureFlag. priority DESC
Traceback (most recent call last): publish, line 131, in publish traverse( obj) http, line 455, in traverse base, line 250, in traverse .callTraversalH ooks(self, obj) launchpad. webapp. publication, line 574, in callTraversalHooks BeforeTraverseE vent(ob, request)) event) event, line 26, in dispatch component. subscribers( event, None) _api, line 138, in subscribers subscribers( objects, interface) registry, line 323, in subscribers subscribers( objects, provided) adapter, line 579, in subscribers n(*objects) profile. profile, line 176, in before_traverse 'profiling. enabled' ): features, line 222, in getFeatureFlag getFlag( flag) features. flags, line 261, in getFlag flags.lookup( flag) features. flags, line 183, in lookup features. flags, line 264, in _checkFlag _needRules( ) features. flags, line 298, in _needRules source. getAllRulesAsDi ct() features. rulesource, line 56, in getAllRulesAsDict sAsTuples( ): features. rulesource, line 135, in getAllRulesAsTuples _connection. execute( self._get_ select( )) .postgr. ..
Module zope.publisher.
obj = request.
Module zope.publisher.
ob = super(HTTPRequest, self).traverse(obj)
Module zope.publisher.
publication
Module canonical.
notify(
Module zope.event, line 23, in notify
subscriber(
Module zope.component.
zope.
Module zope.component.
return sitemanager.
Module zope.component.
return self.adapters.
Module zope.interface.
subscriptio
Module lp.services.
if getFeatureFlag(
Module lp.services.
return features.
Module lp.services.
return self._known_
Module lp.services.
v = self._calc(key)
Module lp.services.
self.
Module lp.services.
self._rules = self.rule_
Module lp.services.
for (flag, scope, priority, value) in self.getAllRule
Module lp.services.
for r in rs:
Module storm.store, line 997, in __iter__
result = self._store.
Module storm.databases