watt (watt__lv) wrote in lj_dev,
watt
watt__lv
lj_dev

I just now upgraded to latest lj CVS code (I am really excited about recent_comments tool), and it all went pretty smooth! Except for one thing - for some people their 'friends' was gone missing...

(i.e. site returns "we are currently working on something" error.)

I saw that my server's error.log shows some errors like this:

[Wed Jul 14 23:43:57 2004] [error] Can't use string ("24493") as an ARRAY ref while "strict refs" in use at /home/lj2004/live/cgi-bin/ljlib.pl line 4122.\n
[Wed Jul 14 23:44:00 2004] [error] Can't use string ("16052") as an ARRAY ref while "strict refs" in use at /home/lj2004/live/cgi-bin/ljlib.pl line 4122.\n


Of course first thing I did is restarted memcached. (Which I forget to do all the time. Gotta clean out them possibly outdated objects from cache first, after code is updated...). But it did not help.

Then, well, I started looked at that line, and I see it's some perl voodoo, which I can't wrap my mind around... for now I "fixed" it like this - wrapping the offending line inside eval{} so it does not crash the whole routine (sub load_userpics):


===================================================================
--- cgi-bin/ljlib.pl (revision 163)
+++ cgi-bin/ljlib.pl (working copy)
@@ -4119,7 +4119,9 @@
my @load_list;
foreach my $row (@{$idlist})
{
- my ($u, $id) = @$row;
+ my $u;
+ my $id;
+ eval { ($u, $id) = @$row; };
next unless ref $u;

if ($LJ::CACHE_USERPIC_SIZE{$id}) {


It's not crashing anymore, but I don't know about any side-effects I might have produced :-)
Please help me understand what is happening in that ill line "my ($u, $id) = @$row" and why it might fail for some users - but not everybody!
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 10 comments