It hit me this morning @ breakfast that my use of uuid1() w/ SQLAlchemy cannot be the problem, at least not the whole problem.
When I used SimpleXMLRPCServer instead of the pylons WSGI stack, everything worked, even when using uuid1(). Also, even when using pylons, the rows were being inserted into the DB just fine, so uuid1() was being called for each new row, and they were getting into the DB quickly and correctly, no blocking behavior at all. The real problem was the final TCP packet not being sent to the client. So I'm back to not understanding why using uuid1() causes the WSGI+TCP/IP stack to break down, and uuid4() does not. The only thing I can think of is that uuid1() access some information about the machine's network hardware to create the GUID, and maybe that access is interfering with TCP/IP? Seems very unlikely. I know how to make the problem go away, but I keep bringing it up because I want to submit a bug report, I just don't know which project I should submit it to. I still don't know the exact problem. On Mar 5, 3:32 pm, Bryan <[email protected]> wrote: > I had never even known about /dev/random > > It is working now, but I think the final thing I will do is push the > GUID creation onto the database server instead of doing it in python > code. One less line of code I need to maintain. > > This was one of the most difficult bugs I've had to deal with in a > long time. Sometimes it is amazing the path that you traverse in > debugging code. This bug had me looking at the pylons source, then > looking at every packet that crossed the wire, and finally looking at > python sources. I've learned a lot in the last few days, I'm going to > eat ice cream now. > > Bryan > > On Mar 5, 3:13 pm, Matthew Zwier <[email protected]> wrote: > > > The 2.5 uuid module tries to use underlying system UUID libraries, so > > the read from /dev/random may be in there instead of in the Python > > code. Don't know what 2.6 does. Hmm...that's not very helpful. I > > know just enough about the internals of Python to be dangerous :) > > > MZ > > > On Thu, Mar 5, 2009 at 4:31 PM, Bryan <[email protected]> wrote: > > > > 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? > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
