Skip Menu |

This queue is for tickets about the Cache-Memcached CPAN distribution.

Report information
The Basics
Id: 54515
Status: new
Priority: 0/
Queue: Cache-Memcached

People
Owner: Nobody in particular
Requestors: crew@cs.stanford.edu (no email address)
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.24
Fixed in: (no value)



Subject: [PATCH] CLONE method for multithread/Apache2-worker-MPM support
version 1.24 fails when loaded under Apache2 multithreaded worker MPM typical error msg is No map found matching for GLOB(0xb7896f0) at /usr/share/perl5/Cache/Memcached.pm line 671. Problem is that spawning a new ithread changes the memory addresses of the socket globs, which then messes up %sock_map. Patch provides a CLONE method to rebuild %sock_map in the new thread. (...probably also need to do locking around the various get/set methods, but at least users can do that much themselves...)
Subject: sockmap.txt
--- /usr/share/perl5/Cache/Memcached-0-.pm 2007-12-23 12:46:00.000000000 -0800 +++ - 2010-02-11 05:49:17.916491905 -0800 @@ -162,6 +162,14 @@ my %sock_map; # stringified-$sock -> "$ip:$port" +sub CLONE { + # rebuild %sock_map for new thread + %sock_map = (); + foreach (keys %cache_sock) { + $sock_map{$cache_sock{$_}} = $_; + } +} + sub _dead_sock { my ($sock, $ret, $dead_for) = @_; if (my $ipport = $sock_map{$sock}) {