I think you are correct. I restarted the server and the problems came back. In my SQLAlchemy setup I use uuid.uuid1(). When I changed this to use uuid4() the problems went away.
I don't have the sources for python 2.5 (what the server runs), but in 2.6 uuid1 sometimes uses the random module, which accesses random generators at the os level. The thing is, in 2.6 the random module uses urandom, so there should not be a problem. Perhaps in 2.5 the random module uses the /dev/random file? On Mar 5, 12:47 pm, Matthew Zwier <[email protected]> wrote: > Could this be something to do with the system entropy pool? If the > uuid module was accessing /dev/random when no entropy was available, > the read from /dev/random would block. If MySQL weren't using > /dev/random, and were using /dev/urandom or something, it would never > block. /dev/random may have replenished itself during your testing > before returning to the original implementation (in Python), hence > you'd have no problem, at least for a while. > > MZ > > On Thu, Mar 5, 2009 at 3:02 PM, Bryan <[email protected]> wrote: > > > The problem only occurred when I was inserting rows into a MySQL table > > that had a guid (char(36)) as the primary key. In my SQLAlchemy > > setup, I assigned uuid.uuid1() to be the default for these columns, so > > python was generating the guid, and it is sent to the server. > > > I first found success when I moved the guid generation to the MySQL > > server side. I let MySQL generate the guid using its uuid() > > function. Everything worked at that point. > > > Now I do not understand the next part. I changed my code back to how > > it originally was, with python generating the guid, and now everything > > works. I don't have any clue what is going on at this point. It > > works, but I don't know why. When I call the broken function > > referenced above, it works now, but nothing in the function's code has > > changed, I have been using a test stub function this whole time so I > > know the code has not changed. > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~----------~----~----~----~------~----~------~--~---
