[ZODB-Dev] [ zodb-Bugs-641925 ] ClientCache tracing data garbled

noreply@sourceforge.net noreply@sourceforge.net
Thu, 21 Nov 2002 10:49:46 -0800


Bugs item #641925, was opened at 2002-11-21 10:23
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=115628&aid=641925&group_id=15628

Category: None
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Guido van Rossum (gvanrossum)
>Assigned to: Guido van Rossum (gvanrossum)
Summary: ClientCache tracing data garbled

Initial Comment:
The ClientCache tracing data can be garbled when there
are multiple ClientStorage instances in the same
process, for example, when external mounts are used.
This is because each ClientStorage instance has its own
ClientCache, and they all use the same environment
variable to open the trace file.

Sharing the trace file really doesn't make any sense
(since the caches aren't shared) so the best we can do
is to set a global variable to indicate that we're
already tracing, and then ignore tracing on subsequent
ClientCache instantiations.

----------------------------------------------------------------------

>Comment By: Guido van Rossum (gvanrossum)
Date: 2002-11-21 13:49

Message:
Logged In: YES 
user_id=6380

Too bad.  People will have to specify different storage names.

I've checked this solution into CVS now (trunk only, though
I presume it should go into the 3.1.1 branch as well).

----------------------------------------------------------------------

Comment By: Chris Withers (fresh)
Date: 2002-11-21 11:44

Message:
Logged In: YES 
user_id=24723

Would a lock help?

I would imagine most people in the situation of having
multiple ClientStorages on a single ZEO client will be in a
similar position to me and will want to analyze the cache
size of each ClientStorage individually.

Would this be possible with a lock?

----------------------------------------------------------------------

Comment By: Guido van Rossum (gvanrossum)
Date: 2002-11-21 11:41

Message:
Logged In: YES 
user_id=6380

Unfortunately, since often the default storage name ("1") is
used multiple times (if they are on different ZEO storage
servers), this isn't enough.  Some kind of lock may be
necessary. :-(

----------------------------------------------------------------------

Comment By: Guido van Rossum (gvanrossum)
Date: 2002-11-21 11:00

Message:
Logged In: YES 
user_id=6380

Very easy, as long as the storage names are distinct!

See patch.

----------------------------------------------------------------------

Comment By: Chris Withers (fresh)
Date: 2002-11-21 10:31

Message:
Logged In: YES 
user_id=24723

What I'd like to see is the file called
os.environ['ZEO_CACHE_TRACE']+'-'+storagename, if you see
what I mean, that way you can get a trace for each mounted
storage as appropriate. I think the storage name specified
in ClientStorage's contructor would be ideal.

In my app, I can imagine the caches needing to be very
different sizes, since each storage varies in size and
number of reads/writes a lot.

Would that be to easy do? 

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=115628&aid=641925&group_id=15628