I first posted this on the HTML_Mason mason_users list, as that's the environment where I first saw this symptom. I though what I was seeing was an artifact of Mason's caching behavior, but I've sinec considered it possible that I'm getting bit instead by a core mod_perl2 behavior under apache 2.0.x.
So, I'm re-posting here; hopefully someone here has some insight. :) ------ Howdy; I have a weird symptom to report. Dunno if it's pilot error, or something odd with my tools. Hopefully someone out there can offer some advice to clear up what I'm seeing. If there's any more data I can provide, I'd be happy to provide it. The background: I often use SDBM-tied hashes to share cheap slow data across concurrent apps. Not much luck under Mason. I've cobbled together a Mason handler.pl that maintains such a tied hash as a global variable. I've written a component that lets me get/set a value in this tied hash. The symptom I see that after a 'set', subsequent 'gets' show me various results; sometimes the data comes back set, sometimes not. I wrote a loop with curl to re-hit my component, with a one-second sleep; the component logs what it sees. Then, I get my component in from another window, to cause the set. Here, HASH(foo) is my tied hash reference, followed by the PID of the apache process handling the request, and a bit representing whether or not my data is seen as set in the tied hash. Two complete loops over all of my http pids: mod_info is HASH(0x9e0f0e4) 8846 0 at /var/www/html/error_test line 35. mod_info is HASH(0x9e0f0e4) 8839 0 at /var/www/html/error_test line 35. mod_info is HASH(0x9e0f0e4) 8840 0 at /var/www/html/error_test line 35. mod_info is HASH(0x9e0f0e4) 8841 0 at /var/www/html/error_test line 35. mod_info is HASH(0x9e0f0e4) 8844 0 at /var/www/html/error_test line 35. mod_info is HASH(0x9e0f0e4) 8845 0 at /var/www/html/error_test line 35. mod_info is HASH(0x9e0f0e4) 8838 1 at /var/www/html/error_test line 35. mod_info is HASH(0x9e0f0e4) 8847 0 at /var/www/html/error_test line 35. mod_info is HASH(0x9e0f0e4) 8846 0 at /var/www/html/error_test line 35. mod_info is HASH(0x9e0f0e4) 8839 0 at /var/www/html/error_test line 35. mod_info is HASH(0x9e0f0e4) 8840 0 at /var/www/html/error_test line 35. mod_info is HASH(0x9e0f0e4) 8841 0 at /var/www/html/error_test line 35. mod_info is HASH(0x9e0f0e4) 8844 0 at /var/www/html/error_test line 35. mod_info is HASH(0x9e0f0e4) 8845 0 at /var/www/html/error_test line 35. mod_info is HASH(0x9e0f0e4) 8838 1 at /var/www/html/error_test line 35. mod_info is HASH(0x9e0f0e4) 8847 0 at /var/www/html/error_test line 35. You can see that the hash ID never alters; seemingly, it's always the same hash. The logs make it seem that only one of my httpd PIDs made the change. If I perform these same experiments with command-line tools, the multiple processes show the data being written to the disk within a second or so, and all of the processes showing that tied hash reflect the change quickly. At the end of this message is a simple tool to demonstrate what I expect, save as 'dbreader'. Just takes key/value pairs on the command line, writes to the tied hash, then loops, displaying the contents of the hash. In one window, ./dbreader apples cherries grapes bananas And in another, ./dbreader apples pineapples grapes peaches I can have as many of these as I want running at the same time, and it Just Works. Somehow, running this under apache/mason/mod_perl violates my expectations. The tools on my system: >From RedHat: # uname -r 2.6.9-42.0.10.EL # perl -v This is perl, v5.8.5 built for i386-linux-thread-multi (From Red Hat's perl-5.8.5-36.RHEL4) From: http://www.openfusion.com.au/mrepo/centos4-i386/ libapreq2-2.08-1.el4.i686.rpm mod_perl-2.0.3-1.of.el4.i686.rpm perl-libapreq2-2.08-1.el4.i686.rpm >From Dries: perl-HTML-Mason-1.3101-1.2.el4.rf.noarch.rpm (plus depandancies) #-------------- #!/usr/bin/perl -w use strict; use POSIX; use SDBM_File; my $dbclass = 'SDBM_File'; my $loc = 'testing'; my %info=(); my $hashref = { @ARGV }; tie (%info, $dbclass, $loc, O_RDWR|O_CREAT, 0640) || die "$0: can't tie $loc: $!"; %info = %{$hashref}; while(1) { print "----\n"; foreach (sort keys %info) { print "$_: $info{$_}\n"; } sleep 1; } #-------------- -- Brian Reichert <[EMAIL PROTECTED]> 55 Crystal Ave. #286 Daytime number: (603) 434-6842 Derry NH 03038-1725 USA BSD admin/developer at large