[rt-users] SelfService interface probs

Robie Basak robie at principle.co.uk
Thu Aug 15 04:24:52 EDT 2002


On Wed, 2002-08-14 at 20:32, Josh Richards wrote:
> * Robie Basak <robie at principle.co.uk> [20020814 01:50]:
> [..]
> > Thinking about it, I can make a guess as to what's happening.
> > 
> > One instance of Apache handled the first request (to create the ticket
> > or whatever). That corresponding instance of RT created the ticket
> > inside a database transaction, and committed it.
> > 
> > Then, another instance (hence definitely a different db handle) did a
> > query. There's no guarantee that the transaction will yet be seen by
> > anyone else, because transactions either get seen or don't. So
> > presumably the database was still busy with it, and would've only shown
> > it's existence to the previous instance.
> > 
> > So, if I'm right, using the same db handle consistently would fix it.
> > I'm not sure if that corresponds to running a single apache process or
> > not, but whichever way it would hit performance.
> > 
> > Or the second instance should wait until the first's transaction
> > appears, but there's no guarantee that it will because you could've
> > requested to view an invalid ticket.
> > 
> > I suppose that's just an example of why web-based interfaces aren't
> > ideal for these things, though unfortunately it's the best we have at
> > the moment.
> [..]
> 
> Hmm...maybe a well situations sleep(x) would take care of it? :-)  You
> think?

Yeah, it would help, but it's an evil hack which:
   a) Still isn't guaranteed to work (if the sleep isn't long enough,
there is no upper limit on how long the db will take)
   b) An evil hack
   c) Will slow things down unnecessarily when the db is being faster

I suppose the nicest way of doing it would be a wait=1 parameter to the
URL (or something similar) and somewhere the db query would be repeated
with something like a quadratic retry schedule up to maybe about 8 or 16
seconds :)

It'd still be evil though.

This is something I need to deal with too, I think I might just do your
sleep suggestion; I doubt anyone would want to integrate that into the
main tree though :)

Robie.




More information about the rt-users mailing list