[LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm
albertel
lon-capa-cvs-allow@mail.lon-capa.org
Wed, 05 Sep 2007 17:37:52 -0000
albertel Wed Sep 5 13:37:52 2007 EDT
Modified files:
/loncom/lonnet/perl lonnet.pm
Log:
- work around bug in Cache::Memcache 1.21 (it fails to internally properly
detect when the memcached restarts, and that it now has a stale socket,
forcing it to disconnect in that case)
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.909 loncom/lonnet/perl/lonnet.pm:1.910
--- loncom/lonnet/perl/lonnet.pm:1.909 Fri Aug 31 08:33:29 2007
+++ loncom/lonnet/perl/lonnet.pm Wed Sep 5 13:37:51 2007
@@ -1,7 +1,7 @@
# The LearningOnline Network
# TCP networking package
#
-# $Id: lonnet.pm,v 1.909 2007/08/31 12:33:29 raeburn Exp $
+# $Id: lonnet.pm,v 1.910 2007/09/05 17:37:51 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1223,8 +1223,10 @@
$time=600;
}
if ($debug) { &Apache::lonnet::logthis("Setting $id to $value"); }
- if (!($memcache->set($id,$setvalue,$time))) {
+ my $result = $memcache->set($id,$setvalue,$time);
+ if (! $result) {
&logthis("caching of id -> $id failed");
+ $memcache->disconnect_all();
}
# need to make a copy of $value
#&make_room($id,$value,$debug);