Site SQL problem when accessing as anonymous user

Submitted by wouter
on February 11, 2004 - 9:53am

Uhm... What would be the best way to explain this...

screenshot


user error: Duplicate entry 'taxnav:block:latest_updates' for key 1
query: INSERT INTO cache (cid, data, created, expire) VALUES('taxnav:block:latest_updates', 'News:
  • Features (02/03)
  • Interviews (02/03)
  • in /home/http/kerneltrap43/includes/database.mysql.inc on line 90.

race condition

Jeremy
on
February 11, 2004 - 12:57pm

Yes, this is a known race condition that I need to make time to address... I wrote locking code that I thought fixed this, but obviously not.

Hopefully I'll get to this soon.

quick fix

Jeremy
on
February 11, 2004 - 5:32pm

BTW: If you ever see this error being displayed and want it to go away, you can help by posting a comment... That will result in the cache being flushed and the page being regenerated -- odds are pretty good that it won't race two times in a row.

But I'll get to fixing the actual problem soon, I hope.

real fix

Jeremy
on
February 24, 2004 - 4:16pm

But I'll get to fixing the actual problem soon, I hope.

Okay, I believe that this error won't happen any more. I fixed my locking code. There were a couple problems in it: 1) I had to assign a key to every lock to be sure the right copy of the lock was being unlocked, and 2) I had to add a brief sleep to work around MySQL 4 optimizations.

If you see any more of these errors, please let me know.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.