[ZODB-Dev] [Performance] excessive time
in "Connection.afterCompletion"
Jim Fulton
jim at zope.com
Sun Apr 2 16:19:06 EDT 2006
Dieter Maurer wrote:
> Hi Tim,
>
> Tim Peters wrote at 2006-3-31 18:48 -0500:
>
>>...
>>
>>>What is the motivation to request synchronized transaction completion
>>>by default?
>>
>>Primarily so we could stop seeing endless threads on zodb-dev asking
>>why ZEO clients that didn't happen to modify any objects never saw
>>current data. From the NEWS file:
>>
>>- (3.4a6) Relatedly, ``Connection`` implements ``ISynchronizer``, and
>> ``Connection``'s ``afterCompletion()`` and ``newTransaction()`` methods now
>> call ``sync()`` on the underlying storage (if the underlying storage has
>> such a method), in addition to processing invalidations. The practical
>> implication is that storage synchronization will be done automatically now,
>> whenever a transaction is explicitly started, and after top-level
>> transaction commit or abort. As a result, ``Connection.sync()`` should
>> virtually never be needed anymore, and will eventually be deprecated.
>
>
> Based on my observation, I fear it is a too expensive measure.
>
> If an asyncore mainloop (or something equivalent) is running,
> then we would get the same effect without the sync.
> Maybe we should go this route (and ensure instead that a mainloop is
> always running).
You can do that now. Just start a thread with the main loop.
My plan, sometime in the future, uh, when I have time, is to
implement a separate thread (or pair of threads) to handle ZEO
network communication independent of any mainloop.
Jim
--
Jim Fulton mailto:jim at zope.com Python Powered!
CTO (540) 361-1714 http://www.python.org
Zope Corporation http://www.zope.com http://www.zope.org
More information about the ZODB-Dev
mailing list