Page MenuHomePhorge

Fix relation handling in syncroton
ClosedPublic

Authored by mollekopf on Thu, Aug 29, 8:34 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Sep 8, 2:55 AM
Unknown Object (File)
Sat, Sep 7, 3:05 PM
Unknown Object (File)
Thu, Sep 5, 8:58 PM
Unknown Object (File)
Thu, Sep 5, 6:58 PM
Unknown Object (File)
Wed, Sep 4, 10:40 PM
Unknown Object (File)
Wed, Sep 4, 7:02 PM
Unknown Object (File)
Wed, Sep 4, 5:26 AM
Unknown Object (File)
Tue, Sep 3, 11:15 PM
Subscribers

Details

Summary

We had a variety of issues in the syncroton handling code:

  • Race conditions where sometimes we wouldn't detect changes or attempt duplicate inserts
  • Invalid handling of an empty set of members in the cache (use of empty instead of isset)
  • Invalid resetting of the cache before reading, resulting in duplicate inserts

The solution is somewhat messy because we really shouldn't be using timestamps for this, but rather attach the information to the syncstate, but this seems to fix most of the issues and gets the test to reliably pass.

Supersedes https://git.kolab.org/D4896

Diff Detail

Repository
rS syncroton
Branch
dev/relationfixes
Lint
Lint Skipped
Unit
No Test Coverage
Build Status
Buildable 48834
Build 18339: arc lint + arc unit

Event Timeline

mollekopf created this revision.
mollekopf retitled this revision from RelationsTest to Fix relation handling in syncroton.Thu, Aug 29, 8:38 AM
mollekopf edited the summary of this revision. (Show Details)
mollekopf added a reviewer: Syncroton Developers.

Another less confusing option for the cache would be to use "before" and "after" in the cache instead of timestamps, because we really want to cache two separate things that a timestamp happens to separate usually (but not always).

lib/kolab_sync_storage.php
1987–1988

I need to adjust the comment or the query (I experimented with both variants <> and <)

mollekopf retitled this revision from Fix relation handling in syncroton to RelationsTest.
mollekopf edited the summary of this revision. (Show Details)
  • Adjust cleanup to preserve the "before" timestamp.
mollekopf retitled this revision from RelationsTest to Fix relation handling in syncroton.Thu, Aug 29, 11:01 AM
mollekopf edited the summary of this revision. (Show Details)
machniak subscribed.
machniak added inline comments.
lib/kolab_sync_storage.php
59

You have to change that in kolab_sync_storage_kolab4 too.

1574

You could store $since->format('Y-m-d H:i:s') in a variable and use it for code clarity.

1950

Redundant empty line.

tests/Sync/Sync/RelationsTest.php
156

The cache is an implementation detail we shouldn't be asserting. I guess it can stay for now.

This revision now requires changes to proceed.Thu, Aug 29, 12:03 PM
mollekopf marked 4 inline comments as done.
Adressed comments
This revision is now accepted and ready to land.Thu, Aug 29, 12:25 PM
lib/kolab_sync_storage.php
59

good catch

tests/Sync/Sync/RelationsTest.php
156

This is not a generic activesync test (as opposed to the kolab4 infrastructure test), so I think it's fine. We specifically want to make sure that the cache cleanup actually does something.