engine: enable batching by default (FDO #52669)

This reverts commit c435e937cd.

Commit 7b636720a in libsynthesis fixes an unitialized memory read in
the asynchronous item update code path.

Testing confirms that we can now used batched writes reliably with EDS
(the only backend currently supporting asynchronous writes +
batching), so this change enables it again also for local and
SyncEvolution<->SyncEvolution sync (with asynchronous execution of
contact add/update overlapped with SyncML message exchanges) and other
SyncML syncs (with changes combined into batches and executed at the
end of each message).
This commit is contained in:
Patrick Ohly 2014-07-21 13:40:29 +02:00
parent 0c989eb74d
commit d06e40d365
2 changed files with 2 additions and 6 deletions

View file

@ -576,10 +576,10 @@ bool EvolutionContactSource::getContact(const string &luid, EContact **contact,
;
switch (m_accessMode) {
case SYNCHRONOUS:
case DEFAULT:
order = READ_NONE;
break;
case BATCHED:
case DEFAULT:
order = m_readAheadOrder;
break;
};
@ -1039,7 +1039,6 @@ EvolutionContactSource::insertItem(const string &uid, const std::string &item, b
invalidateCachedContact(uid);
switch (m_accessMode) {
case SYNCHRONOUS:
case DEFAULT:
if (uid.empty()) {
gchar* newuid;
if (!e_book_client_add_contact_sync(m_addressbook, contact, &newuid, NULL, gerror)) {
@ -1057,6 +1056,7 @@ EvolutionContactSource::insertItem(const string &uid, const std::string &item, b
}
break;
case BATCHED:
case DEFAULT:
std::string name = StringPrintf("%s: %s operation #%d",
getDisplayName().c_str(),
uid.empty() ? "add" : ("insert " + uid).c_str(),

View file

@ -64,10 +64,6 @@ DBusSync::DBusSync(const SessionCommon::SyncParams &params,
if (params.m_mode == "ephemeral") {
makeEphemeral();
} else if (params.m_mode == "pbap") {
// Batched writing is off by default, explicitly enable it for PBAP.
SE_LOG_DEBUG(NULL, "enabling SYNCEVOLUTION_EDS_ACCESS_MODE=batched");
setenv("SYNCEVOLUTION_EDS_ACCESS_MODE", "batched", true);
// "pbap" may only be used by caller when it knows that
// the mode is safe to use.
makeEphemeral();