2.8 SQLAlias leaks

Bug #143492 reported by Chris McDonough
4
Affects Status Importance Assigned to Milestone
Zope 2
New
Medium
Unassigned

Bug Description

When you bind a Shared.DC.ZRDB.Results.Results class to an instance of a 2.8 extensionclass (e.g. self.results = <result instance>), it creates a cycle that eventually manifests itself as SQLAlias reference leaks. This appears to be a resurrection of an ancient bug (ala http://mail.zope.org/pipermail/zope-dev/2000-December/008280.html).

Tags: bug zope
Revision history for this message
Andreas Jung (ajung) wrote :

hm...what is the usecase for binding a Results instance as instance attribute? I can not think of a case where this would make sense.

Revision history for this message
Tres Seaver (tseaver) wrote :

Andreas wrote:

> hm...what is the usecase for binding a Results instance as
> instance attribute? I can not think of a case where this would
> make sense.

1. I have a view for a content object, which execute an SQL
   query and stores the results as an instance of the view, which
   should be only for the life of the request. However, due to
   this bug, the view and all associated objects (the request,
   the SQL results, etc.) leak.

2. I can also imagine this being problematic for caches of the
   SQL results.

Revision history for this message
Tres Seaver (tseaver) wrote :

Uploaded: results_leak.py

Attaching a script which (I think) demonstrates the leak. Here
is output on my machine:

$ bin/zopectl run ../results_leak.py
================================
2.3.5 (#1, Apr 11 2005, 13:18:06)
[GCC 3.3.5 (Debian 1:3.3.5-8ubuntu2)]
================================
--------------------------------
Leak test: None
--------------------------------
leaked: 0

--------------------------------
Leak test: by attribute
--------------------------------
leaked: 16

--------------------------------
Leak test: by item
--------------------------------
leaked: 15

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.