Skip to Content.
Sympa Menu

cc-devel - [cc-devel] [ cctools-Bugs-2728181 ] Race condition in uploads

cc-devel AT lists.ibiblio.org

Subject: Developer discussion for Creative Commons technology and tools

List archive

Chronological Thread  
  • From: "SourceForge.net" <noreply AT sourceforge.net>
  • To: noreply AT sourceforge.net
  • Subject: [cc-devel] [ cctools-Bugs-2728181 ] Race condition in uploads
  • Date: Wed, 22 Apr 2009 22:24:01 +0000

Bugs item #2728181, was opened at 2009-04-03 05:22
Message generated for change (Settings changed) made by fourstones
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=559966&aid=2728181&group_id=80503

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: cchost
Group: None
>Status: Closed
Resolution: Fixed
Priority: 5
Private: No
Submitted By: Markus (mafu_)
Assigned to: Victor Stone (fourstones)
Summary: Race condition in uploads

Initial Comment:
When multiple users upload media at the same time, it's possible that a race
conditions occurs. The problem lies with the NextID()-method in the class
CCTable , which simply gets the next available auto_increment from the
database. So if two users call NextID() concurrently, they get the same ID
back, but only one can insert into the database with that ID -- the other
user gets a MySQL error about a duplicate entry.

We have currently fixed this with a hack, locking the required tables before
the insert (in cc-uploadapi.php), but really the row should be inserted
first, the ID gotten with mysql_insert_id, which can then be used in the rest
of the code.

Regards

----------------------------------------------------------------------

Comment By: Victor Stone (fourstones)
Date: 2009-04-22 15:23

Message:
checked in svn #12354

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=559966&aid=2728181&group_id=80503




Archive powered by MHonArc 2.6.24.

Top of Page