Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Zope Export gets bloated by parent objects
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 1 - 25 of 35 - Collapse all  -  Translate all to Translated (View all originals)   Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Thomas Buchberger  
View profile   Translate to Translated (View Original)
 More options Feb 23 2010, 8:43 am
From: Thomas Buchberger <thomas.buchber...@gmail.com>
Date: Tue, 23 Feb 2010 05:43:42 -0800 (PST)
Local: Tues, Feb 23 2010 8:43 am
Subject: Zope Export gets bloated by parent objects
Hi

I recently noticed a severe slowdown in copy/paste operations with
dexterity objects.

After some investigation I found out that the problems seems to be in
ZEXP.
For some reason every dexterity object has a persistent reference to
it's parent object.
When doing a ZEXP all referenced objects are included, which means
that you always get the full tree of dexterity objects.
As a result ZEXP gets slower and slower the more objects you have.
Copy/Paste is doing a ZEXP when copying an object and therefore also
gets slower.

As an example let's assume the following contents:
(Folder and Subfolder are Dexterity Containers, Files are Dexterity
Items)

Folder->Subfolder1->SmallFile
Folder->Subfolder2->LargeFile

If you do a ZEXP of SmallFile it will also contain LargeFile.

Any suggestions how this problem can be solved?

Cheers,
Thomas


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thomas Buchberger  
View profile  
 More options Feb 23 2010, 8:14 am
From: Thomas Buchberger <thomas.buchber...@gmail.com>
Date: Tue, 23 Feb 2010 14:14:19 +0100
Local: Tues, Feb 23 2010 8:14 am
Subject: Zope Export gets bloated by parent objects
Hi

I recently noticed a severe slowdown in copy/paste operations with dexterity objects.

After some investigation I found out that the problems seems to be in ZEXP.
For some reason every dexterity object has a persistent reference to it's parent object.
When doing a ZEXP all referenced objects are included, which means that you always get the full tree of dexterity objects.
As a result ZEXP gets slower and slower the more objects you have.
Copy/Paste is doing a ZEXP when copying an object and therefore also gets slower.

As an example let's assume the following contents:
(Folder and Subfolder are Dexterity Containers, Files are Dexterity Items)

Folder->Subfolder1->SmallFile
Folder->Subfolder2->LargeFile

If you do a ZEXP of SmallFile it will also contain LargeFile.

Any suggestions how this problem can be solved?

Cheers,
Thomas


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Martin Aspeli  
View profile  
 More options Feb 23 2010, 7:19 pm
From: Martin Aspeli <optil...@gmail.com>
Date: Wed, 24 Feb 2010 08:19:43 +0800
Local: Tues, Feb 23 2010 7:19 pm
Subject: Re: Zope Export gets bloated by parent objects
Hi,

> I recently noticed a severe slowdown in copy/paste operations with
> dexterity objects.

Interesting.

> After some investigation I found out that the problems seems to be in
> ZEXP.
> For some reason every dexterity object has a persistent reference to
> it's parent object.

This is actually done in plone.folder, and so I think it'll be pretty
standard in Plone 4. I've CC'd Andi and Hanno who may know more.
__parent__ pointers are what's going to allow us to eventually stop
mixing a ton of acquisition stuff into our code, so they're there on
purpose. What you're saying is worrying, though!

> When doing a ZEXP all referenced objects are included, which means
> that you always get the full tree of dexterity objects.
> As a result ZEXP gets slower and slower the more objects you have.
> Copy/Paste is doing a ZEXP when copying an object and therefore also
> gets slower.

Scary.

> As an example let's assume the following contents:
> (Folder and Subfolder are Dexterity Containers, Files are Dexterity
> Items)

> Folder->Subfolder1->SmallFile
> Folder->Subfolder2->LargeFile

> If you do a ZEXP of SmallFile it will also contain LargeFile.

> Any suggestions how this problem can be solved?

Not off the top of my head, but I'm hoping Hanno and Andi may have
some thoughts?

Martin


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Glick  
View profile  
 More options Feb 23 2010, 11:07 pm
From: David Glick <dgl...@gmail.com>
Date: Tue, 23 Feb 2010 20:07:28 -0800
Local: Tues, Feb 23 2010 11:07 pm
Subject: Re: Zope Export gets bloated by parent objects
On 2/23/10 4:19 PM, Martin Aspeli wrote:
> Hi
>> I recently noticed a severe slowdown in copy/paste operations with
>> dexterity objects.

Damn.  Someone called this potential problem to my attention last week,
but I hadn't gotten around to seeing if it actually existed yet.
>> Any suggestions how this problem can be solved?

> Not off the top of my head, but I'm hoping Hanno and Andi may have
> some thoughts?

It's not immediately obvious to me what approach we can take to fixing
this.  During ZEXP export, the code is simply following the references
in the ZODB pickles without actually unpickling objects.  So it doesn't
really have a way to evaluate which reference corresponds to the
__parent__ pointer, afaicr.

David


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Hanno Schlichting  
View profile  
 More options Feb 24 2010, 5:36 am
From: Hanno Schlichting <ha...@hannosch.eu>
Date: Wed, 24 Feb 2010 11:36:58 +0100
Local: Wed, Feb 24 2010 5:36 am
Subject: Re: Zope Export gets bloated by parent objects

On Wed, Feb 24, 2010 at 1:19 AM, Martin Aspeli <optil...@gmail.com> wrote:
> This is actually done in plone.folder, and so I think it'll be pretty
> standard in Plone 4. I've CC'd Andi and Hanno who may know more.
> __parent__ pointers are what's going to allow us to eventually stop
> mixing a ton of acquisition stuff into our code, so they're there on
> purpose. What you're saying is worrying, though!

Gah! Do we really store __parent__ pointers on content? I thought we
explicitly decided not to do this yet, as it has too many unknowns and
open problems.

>> When doing a ZEXP all referenced objects are included, which means
>> that you always get the full tree of dexterity objects.
>> As a result ZEXP gets slower and slower the more objects you have.
>> Copy/Paste is doing a ZEXP when copying an object and therefore also
>> gets slower.

> Scary.

Not scary, but exactly the expected behavior ;)

If we want to use persistent partent pointers, we have to deal with
all the adjustments whenever content is moved around, cut/copy/pasted
and exported/imported. Zope3 has a lot of different infrastructure for
these tasks, that know about parent pointers and handle them
correctly. None of that code is in use in Zope2.

For now I'd strongly suggest we remove parent pointers from any
content item. Using them for non persistent view components is quite
fine and we can keep doing that, but there's far too many subtle
problems when using them on persistent content.

Hanno


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andreas Zeidler  
View profile  
 More options Feb 24 2010, 6:59 am
From: Andreas Zeidler <a...@zitc.de>
Date: Wed, 24 Feb 2010 12:59:16 +0100
Local: Wed, Feb 24 2010 6:59 am
Subject: Re: Zope Export gets bloated by parent objects
On 24.02.2010, at 11:36, Hanno Schlichting wrote:

> On Wed, Feb 24, 2010 at 1:19 AM, Martin Aspeli <optil...@gmail.com> wrote:
>> This is actually done in plone.folder, and so I think it'll be pretty
>> standard in Plone 4.

right.  

this might actually also be the reason for the pretty hefty slowdown when running some tests against p4, for example `p.a.blob`.  i haven't yet had the time to investigate, but with this pointer i'll try to have a look during friday's tuneup.

> Gah! Do we really store __parent__ pointers on content?

we do.  i've just checked again (r26681 & r26682), and the pointers are indeed set on every content item (which makes sense when it's supposed to replace acquisition, of course).

> For now I'd strongly suggest we remove parent pointers from any
> content item. Using them for non persistent view components is quite
> fine and we can keep doing that, but there's far too many subtle
> problems when using them on persistent content.

considering that this problem will probably show up in a lot of places, i'd be +1.  martin, what do you think?  i can poke a bit more on friday, but i think that's also when we should have a decision at the latest...

andi

--
zeidler it consulting - http://zitc.de/ - i...@zitc.de
friedelstraße 31 - 12047 berlin - telefon +49 30 25563779
pgp key at http://zitc.de/pgp - http://wwwkeys.de.pgp.net/
plone 4.0 alpha released! -- http://plone.org/products/plone/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andreas Zeidler  
View profile  
 More options Feb 24 2010, 7:03 am
From: Andreas Zeidler <a...@zitc.de>
Date: Wed, 24 Feb 2010 13:03:36 +0100
Local: Wed, Feb 24 2010 7:03 am
Subject: Re: Zope Export gets bloated by parent objects
On 24.02.2010, at 12:59, Andreas Zeidler wrote:

> On 24.02.2010, at 11:36, Hanno Schlichting wrote:
>> For now I'd strongly suggest we remove parent pointers from any
>> content item. Using them for non persistent view components is quite
>> fine and we can keep doing that, but there's far too many subtle
>> problems when using them on persistent content.

> considering that this problem will probably show up in a lot of places, i'd be +1.  martin, what do you think?  i can poke a bit more on friday, but i think that's also when we should have a decision at the latest...

btw, could someone — perhaps thomas as the discoverer :) — please file a (critical) bug report on the p4 tracker for this?

> andi

--
zeidler it consulting - http://zitc.de/ - i...@zitc.de
friedelstraße 31 - 12047 berlin - telefon +49 30 25563779
pgp key at http://zitc.de/pgp - http://wwwkeys.de.pgp.net/
plone 4.0 alpha released! -- http://plone.org/products/plone/

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Martin Aspeli  
View profile  
 More options Feb 24 2010, 9:18 am
From: Martin Aspeli <optil...@gmail.com>
Date: Wed, 24 Feb 2010 22:18:36 +0800
Local: Wed, Feb 24 2010 9:18 am
Subject: Re: Zope Export gets bloated by parent objects
On 24 February 2010 19:59, Andreas Zeidler <a...@zitc.de> wrote:

We added them to Dexterity (and then pushed down to plone.folder) on
the assumption that we'd want this for future compatibility in an
acquisition-free world. I don't think they're used anywhere important,
so we can remove them if that's the right thing to do.

Not quite sure what to do with existing Dexterity instances, though...

Andi, will you follow up on this as the owner of p.folder? I'll test
with Dexterity and fix that up once we've got a new p.folder release,
but for now Plone 4 is the more important consumer of that package.

Martin


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thomas Buchberger  
View profile  
 More options Feb 24 2010, 11:12 am
From: Thomas Buchberger <thomas.buchber...@gmail.com>
Date: Wed, 24 Feb 2010 17:12:39 +0100
Local: Wed, Feb 24 2010 11:12 am
Subject: Re: Zope Export gets bloated by parent objects

Am 24.02.2010 um 13:03 schrieb Andreas Zeidler:

> On 24.02.2010, at 12:59, Andreas Zeidler wrote:
>> On 24.02.2010, at 11:36, Hanno Schlichting wrote:
>>> For now I'd strongly suggest we remove parent pointers from any
>>> content item. Using them for non persistent view components is quite
>>> fine and we can keep doing that, but there's far too many subtle
>>> problems when using them on persistent content.

>> considering that this problem will probably show up in a lot of places, i'd be +1.  martin, what do you think?  i can poke a bit more on friday, but i think that's also when we should have a decision at the latest...

> btw, could someone — perhaps thomas as the discoverer :) — please file a (critical) bug report on the p4 tracker for this?

I'm not sure if the issue really exists in plone4.
In a quick test with plone 4.0a5 and archetypes objects doing a zexp export no parents were included.
Even though the objects do have a __parent__ pointer.
Maybe I missed something or the newer zope version can handle the __parent__ pointer?

I had the issue with plone3.3 and dexterity 1.0a3
Can anybody reproduce the issue with plone4?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andreas Zeidler  
View profile  
 More options Feb 24 2010, 4:23 pm
From: Andreas Zeidler <a...@zitc.de>
Date: Wed, 24 Feb 2010 22:23:25 +0100
Local: Wed, Feb 24 2010 4:23 pm
Subject: Re: Zope Export gets bloated by parent objects
On 24.02.2010, at 15:18, Martin Aspeli wrote:

> Andi, will you follow up on this as the owner of p.folder?

yes, i will.  like i said, i'll try to reproduce thomas' results on friday (during the tuneup).  his latest mail makes me a little less worried, though... :)

> I'll test
> with Dexterity and fix that up once we've got a new p.folder release,
> but for now Plone 4 is the more important consumer of that package.

right, thanks!

andi

--
zeidler it consulting - http://zitc.de/ - i...@zitc.de
friedelstraße 31 - 12047 berlin - telefon +49 30 25563779
pgp key at http://zitc.de/pgp - http://wwwkeys.de.pgp.net/
plone 4.0 alpha released! -- http://plone.org/products/plone/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ross Patterson  
View profile  
 More options Feb 24 2010, 4:43 pm
From: Ross Patterson <m...@rpatterson.net>
Date: Wed, 24 Feb 2010 13:43:09 -0800
Local: Wed, Feb 24 2010 4:43 pm
Subject: Re: Zope Export gets bloated by parent objects

I don't suppose an implementation using persistent.wref could be used to
avoid this problem?  Does the ZEXP machinery honor persistent.wref in
the same way that the gc does?  Could it be made to do so?

Ross


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Glick  
View profile  
 More options Feb 24 2010, 4:47 pm
From: David Glick <dgl...@gmail.com>
Date: Wed, 24 Feb 2010 13:47:08 -0800
Local: Wed, Feb 24 2010 4:47 pm
Subject: Re: Zope Export gets bloated by parent objects
On 2/24/10 1:43 PM, Ross Patterson wrote:

That might work.  The ZEXP export code does not follow weak references,
IIRC.
David

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Martin Aspeli  
View profile  
 More options Feb 24 2010, 7:21 pm
From: Martin Aspeli <optil...@gmail.com>
Date: Thu, 25 Feb 2010 08:21:40 +0800
Local: Wed, Feb 24 2010 7:21 pm
Subject: Re: Zope Export gets bloated by parent objects
On 25 February 2010 05:47, David Glick <dgl...@gmail.com> wrote:

> That might work.  The ZEXP export code does not follow weak references,
> IIRC.

Does the "new" acquisition?

Martin


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andreas Zeidler  
View profile  
 More options Feb 24 2010, 8:09 pm
From: Andreas Zeidler <a...@zitc.de>
Date: Thu, 25 Feb 2010 02:09:26 +0100
Local: Wed, Feb 24 2010 8:09 pm
Subject: Re: Zope Export gets bloated by parent objects
On 24.02.2010, at 17:12, Thomas Buchberger wrote:

> I'm not sure if the issue really exists in plone4.
> In a quick test with plone 4.0a5 and archetypes objects doing a zexp export no parents were included.
> Even though the objects do have a __parent__ pointer.
> Maybe I missed something or the newer zope version can handle the __parent__ pointer?

i've grep'd the code a bit, but couldn't find anything that would treat `__parent__` in any special way.  i've also added a test[*] trying to reproduce the problem, but it passes both on plone 3 and 4.  well, actually i should say both on zope 2.10 and 2.12 as the test is not really plone-specific.  in any case, the parents are not part of the export, so maybe the issue is dexterity-specific after all.

however, perhaps i'm missing something or maybe the test setup is wrong.  could somebody please review[*] & give me some feedback?  tomorrow i'll also try to test ttw as well as moving the test into `p.a.folder` to check against "real" plone content.

good night,

andi

[*] https://dev.plone.org/plone/changeset/34337

--
zeidler it consulting - http://zitc.de/ - i...@zitc.de
friedelstraße 31 - 12047 berlin - telefon +49 30 25563779
pgp key at http://zitc.de/pgp - http://wwwkeys.de.pgp.net/
plone 4.0 alpha released! -- http://plone.org/products/plone/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ross Patterson  
View profile  
 More options Feb 24 2010, 8:12 pm
From: Ross Patterson <m...@rpatterson.net>
Date: Wed, 24 Feb 2010 17:12:10 -0800
Local: Wed, Feb 24 2010 8:12 pm
Subject: Re: Zope Export gets bloated by parent objects

Martin Aspeli <optil...@gmail.com> writes:
> On 25 February 2010 05:47, David Glick <dgl...@gmail.com> wrote:

>> That might work.  The ZEXP export code does not follow weak references,
>> IIRC.

> Does the "new" acquisition?

I was thinking that whatever code sets the __parent__ refs (I believe
someone said it was moved into p.a.folder?) should do so in such a way
that uses persistent.wref.  I think it might have to involve a
descriptor of some sort since wrefs need to be called.

Ross


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Hanno Schlichting  
View profile  
 More options Feb 25 2010, 4:13 am
From: Hanno Schlichting <ha...@hannosch.eu>
Date: Thu, 25 Feb 2010 10:13:23 +0100
Local: Thurs, Feb 25 2010 4:13 am
Subject: Re: Zope Export gets bloated by parent objects

On Thu, Feb 25, 2010 at 2:12 AM, Ross Patterson <m...@rpatterson.net> wrote:
> I was thinking that whatever code sets the __parent__ refs (I believe
> someone said it was moved into p.a.folder?) should do so in such a way
> that uses persistent.wref.  I think it might have to involve a
> descriptor of some sort since wrefs need to be called.

Having to call them rules out their use for this use-case. The
ILocation API is pretty clear here and requires __parent__ to be an
attribute that is the parent object - not a callable. One point of
introducing these is getting API compatibility with all the Zope
Toolkit code and all of that is expecting a simple attribute.

Descriptors and properties don't work with Acquisition. We want to get
rid of Acquisition in the end, but we are going to have a transition
period. In that period we'll need to support a mix of parent pointers
and Acquisition, which rules out the use of descriptors and properties
here as well.

Hanno


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alec Mitchell  
View profile  
 More options Feb 25 2010, 10:26 am
From: Alec Mitchell <ap...@columbia.edu>
Date: Thu, 25 Feb 2010 07:26:34 -0800
Local: Thurs, Feb 25 2010 10:26 am
Subject: Re: Zope Export gets bloated by parent objects
On Feb 25, 2010, at 1:13 AM, Hanno Schlichting <ha...@hannosch.eu>  
wrote:

The parent pointers themselves need not be acquisition wrapped  
though.  In fact they currently aren't wrapped unless they've just  
been set.  Using a descriptor would make the behavior more consistent  
in that regard.  Of course it also would add additional complexity,  
and if this can be addressed more straightforwardly, that would be  
preferable.

Alec


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Laurence Rowe  
View profile  
 More options Feb 25 2010, 10:29 am
From: Laurence Rowe <laurencer...@gmail.com>
Date: Thu, 25 Feb 2010 15:29:42 +0000
Local: Thurs, Feb 25 2010 10:29 am
Subject: Re: Zope Export gets bloated by parent objects
On 25 February 2010 15:26, Alec Mitchell <ap...@columbia.edu> wrote:

Wouldn't just setting obj.__parent__ = aq_base(container) achieve the same?

Laurence


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Martin Aspeli  
View profile  
 More options Feb 25 2010, 10:33 am
From: Martin Aspeli <optil...@gmail.com>
Date: Thu, 25 Feb 2010 23:33:21 +0800
Local: Thurs, Feb 25 2010 10:33 am
Subject: Re: Zope Export gets bloated by parent objects
On 25 February 2010 23:29, Laurence Rowe <laurencer...@gmail.com> wrote:

In this case, __parent__ would be a descriptor wrapping a
persistent.weakref you mean?

What happens to existing Dexterity content if we suddenly add a
__parent__ descriptor on the DexterityContent class? Will existing
attributes still shadow it?

And what do we do about content that doesn't have such a __parent__
descriptor? Remember that the setting of __parent__ is actually done
in __setitem__ on the container, not by the object itself! Do we set
the descriptor as an instance variable? Does that even work? :)

Martin


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Laurence Rowe  
View profile  
 More options Feb 25 2010, 11:16 am
From: Laurence Rowe <laurencer...@gmail.com>
Date: Thu, 25 Feb 2010 16:16:41 +0000
Local: Thurs, Feb 25 2010 11:16 am
Subject: Re: Zope Export gets bloated by parent objects
On 25 February 2010 15:33, Martin Aspeli <optil...@gmail.com> wrote:

"The property() function is implemented as a data descriptor.
Accordingly, instances cannot override the behavior of a property."
http://docs.python.org/reference/datamodel.html#invoking-descriptors

I think the following should work:

class Foo(Acqusition.Implicit):
    __parent__ = property(lambda self: self._parent_wref(), lambda
self, value: setattr(self, '_parent_wref', WeakRef(value))

... but, this feels like a horrible hack!

Laurence


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alec Mitchell  
View profile  
 More options Feb 25 2010, 11:52 am
From: Alec Mitchell <ap...@columbia.edu>
Date: Thu, 25 Feb 2010 08:52:31 -0800
Local: Thurs, Feb 25 2010 11:52 am
Subject: Re: Zope Export gets bloated by parent objects

This is what happens when I post too early in the morning.  The
__parent__ pointers are wrapped.  Generally, the acquisition parent of
the __parent__ is the child object itself (which is strange and
unintuitive of course), except when first set, at which point the
parent is wrapped with its usual traversal path.  Getting rid of the
wrappers with a descriptor may still be a win in terms of eliminating
this confusinon, unless there's a compelling case for e.g. needing to
make security assertions on the __parent__ objects.

I agree with Laurence though, this feels like a huge hack.  If the
problem isn't with __parent__ generally, as Andi seems to indicate,
then I don't think this is a rabbit hole we want to go down.

Alec


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andreas Zeidler  
View profile  
 More options Feb 28 2010, 6:14 pm
From: Andreas Zeidler <a...@zitc.de>
Date: Mon, 1 Mar 2010 00:14:51 +0100
Local: Sun, Feb 28 2010 6:14 pm
Subject: Re: Zope Export gets bloated by parent objects
On 25.02.2010, at 17:52, Alec Mitchell wrote:

> I agree with Laurence though, this feels like a huge hack.

+1

> If the problem isn't with __parent__ generally, as Andi seems to indicate,
> then I don't think this is a rabbit hole we want to go down.

well, after some ttw testing and looking at pickles, i realized that the reason plone isn't affected is because __parent__ only gets set if the object provides `ILocation` (in `plone.folder` that is), and afaics that isn't used anywhere.  it might be pulled in for some objects via `zope.app.container` or something, but at least ATCT content doesn't have it.

so iow, the problem probably is due to the __parent__ pointers, but since plone's not using `ILocation` it indeed only shows with dexterity.  thomas was right here, except for the pointers.  they were never set on the objects themselves, but kindly provided by acquisition (what else!? :)).

good night,

andi

ps: luckily we don't need any migration/cleanup either.

--
zeidler it consulting - http://zitc.de/ - i...@zitc.de
friedelstraße 31 - 12047 berlin - telefon +49 30 25563779
pgp key at http://zitc.de/pgp - http://wwwkeys.de.pgp.net/
plone 4.0 alpha released! -- http://plone.org/products/plone/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Hanno Schlichting  
View profile  
 More options Feb 28 2010, 6:30 pm
From: Hanno Schlichting <ha...@hannosch.eu>
Date: Mon, 1 Mar 2010 00:30:35 +0100
Local: Sun, Feb 28 2010 6:30 pm
Subject: Re: Zope Export gets bloated by parent objects

On Mon, Mar 1, 2010 at 12:14 AM, Andreas Zeidler <a...@zitc.de> wrote:
> well, after some ttw testing and looking at pickles, i realized that the reason plone isn't affected is because __parent__ only gets set if the object provides `ILocation` (in `plone.folder` that is), and afaics that isn't used anywhere.  it might be pulled in for some objects via `zope.app.container` or something, but at least ATCT content doesn't have it.

Ah, awesome. So the only things affected are Dexterity and stuff based
on those weirdo helper classes in plone.app.content - neither of which
Plone uses.

> so iow, the problem probably is due to the __parent__ pointers, but since plone's not using `ILocation` it indeed only shows with dexterity.  thomas was right here, except for the pointers.  they were never set on the objects themselves, but kindly provided by acquisition (what else!? :)).

Aha. And indeed Acquisition wrappers have a __parent__ that is an
alias for aq_parent. The actual aq_base(object) won't have a
__parent__.

Thanks for investigating this,
Hanno


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Martin Aspeli  
View profile  
 More options Feb 28 2010, 8:33 pm
From: Martin Aspeli <optil...@gmail.com>
Date: Mon, 1 Mar 2010 09:33:47 +0800
Local: Sun, Feb 28 2010 8:33 pm
Subject: Re: Zope Export gets bloated by parent objects
On 1 March 2010 07:30, Hanno Schlichting <ha...@hannosch.eu> wrote:

> On Mon, Mar 1, 2010 at 12:14 AM, Andreas Zeidler <a...@zitc.de> wrote:
>> well, after some ttw testing and looking at pickles, i realized that the reason plone isn't affected is because __parent__ only gets set if the object provides `ILocation` (in `plone.folder` that is), and afaics that isn't used anywhere.  it might be pulled in for some objects via `zope.app.container` or something, but at least ATCT content doesn't have it.

> Ah, awesome. So the only things affected are Dexterity and stuff based
> on those weirdo helper classes in plone.app.content - neither of which
> Plone uses.

True, but that still leaves the question about what to do with Dexterity. ;-)

 - Remove the functionality from plone.folder?

 - Leave the functionality in plone.folder and remove ILocation from
Dexterity objects (seems dumb/dangerous)

 - Add a __parent__ get/set property that delegates to a
persistent.weakref (any acquisition problems with this?)

Martin


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Laurence Rowe  
View profile  
 More options Feb 28 2010, 8:51 pm
From: Laurence Rowe <laurencer...@gmail.com>
Date: Mon, 1 Mar 2010 01:51:57 +0000
Local: Sun, Feb 28 2010 8:51 pm
Subject: Re: Zope Export gets bloated by parent objects
On 1 March 2010 01:33, Martin Aspeli <optil...@gmail.com> wrote:

> On 1 March 2010 07:30, Hanno Schlichting <ha...@hannosch.eu> wrote:
>> On Mon, Mar 1, 2010 at 12:14 AM, Andreas Zeidler <a...@zitc.de> wrote:
>>> well, after some ttw testing and looking at pickles, i realized that the reason plone isn't affected is because __parent__ only gets set if the object provides `ILocation` (in `plone.folder` that is), and afaics that isn't used anywhere.  it might be pulled in for some objects via `zope.app.container` or something, but at least ATCT content doesn't have it.

>> Ah, awesome. So the only things affected are Dexterity and stuff based
>> on those weirdo helper classes in plone.app.content - neither of which
>> Plone uses.

> True, but that still leaves the question about what to do with Dexterity. ;-)

>  - Remove the functionality from plone.folder?

+1. It seems silly to leave this functionality in place if it is not used.

>  - Leave the functionality in plone.folder and remove ILocation from
> Dexterity objects (seems dumb/dangerous)

I would remove ILocation from Dexterity objects too, as it will no
longer fulfil those expectations.

>  - Add a __parent__ get/set property that delegates to a
> persistent.weakref (any acquisition problems with this?)

-1. This is unnecessarily complex.

Laurence


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Messages 1 - 25 of 35   Newer >
« Back to Discussions « Newer topic     Older topic »