comment closing race



I just found a race when debugging why closed comments sometimes don't
show up, even though the live comment gets removed (but reloading fixes
it).

It turns out that this is a race. We signal the ActiveTopic changed
before the xmlrpc call is done. This means the transaction is not
commited yet. A quick client can then re-dump the topic before the
transaction, missing the new comment.

I'm not sure what a good way to handle this is. We could either delay
the signalChanged until the transaction has been commited, or we could
commit the transaction before returning from the xmlrpc call.

I think i'm leaning towards delaying the signalChanged calls. One could
queue up the objects in a thread-local variable and then call them at
the end. There might be other places where the non-persistant vs
transactioned changes hit us though, and we need to make sure we solve
all of them.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's an old-fashioned Jewish jungle king from the Mississippi delta. She's a 
radical belly-dancing stripper from Mars. They fight crime! 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]