Re: 8 open connections with a pool_size of 7

"Dieter Maurer" <[email protected]>
Newsgroups gmane.comp.web.zope.german
Message-ID <[email protected]>
Stefan Palme wrote at 2009-4-8 18:30 +0200:
>hierzu habe ich nun doch noch mal eine Verständnisfrage (vor allem,
>weil das Problem nach wie vor besteht):

Ich habe diese Woche ein "ZODB-Connection" Leck entdeckt:
PAS (PluggableAuthenticationService) hat Chancen für jedes
"Unauthorited" eine Connection zu verlieren.

Hier eine Beschreibung mit Workaround:

= Introduction =
The upgrade to Zope 2.11 brought us a nasty ZODB connection leak.
The analysis revealed that the leak was caused by `PluginRegistry` in
cooperation with `PluggableAuthService` and Zope's error handling.

`PluggableAuthService` overrides `Response._unauthorized` to call
its `challenge` method. Zope's error handling reraises `Unauthorized`.
This exception is caught by `ZPublisher.publish_module` '''after''' the
transaction has been aborted. `publish_module` reports caught exceptions
by calling `response.exception` which in turn calls `_unauthorized` for
`Unauthorized` exceptions. Thus, `PluggableAuthService.challenge` is
called after the transaction has been aborted. `challenge` calls
`PluginRegistry._getPlugins` which sometimes changes persistent objects.
When this happens, a new transaction is automatically created and the
connection joins this transaction. When later the request is closed,
the ZODB connection refuses to be close because it is still joined
to a transaction. The corresponding exception is caught by Python, a
message is written to `stderr` (usually redirected to `/dev/null`), then
the exception is forgotten,
as it happens inside of a `__del__` method. The only visible effect
is a leaked connection (the one that refused to get closed).

= Feature =
Change `App.ZApplication.Cleanup.__del__` to abort the transaction
before the connection close is closed.



-- 
Dieter


_______________________________________________
zope mailing list
[email protected]
https://mail.dzug.org/mailman/listinfo/zope
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.