Closed novakboskov closed 4 years ago
PR #61 is created for this issue. The architecture of syncTest is as follows:
Actually, I have further simplified it now:
I have written here semi-formally how syncTest
is expected to behave:
For all syncs that implement GenSync
, syncTest
tests that the following guarantees hold:
Let Peer P1 be client with data - set A
: GenSyncClient
and Peer P2 be server with data - set B
: GenSyncServer
Now, GenSyncClient synchroizes using GenSync :: clientSyncBegin, and GenSyncServer synchroizes using GenSync :: serverSyncBegin
At the end, GenSyncServer data is modified. The server is now expected to have the data - set A U B
.
For "one-way" syncs, the client should be unchanged, else the client is also modified to contain data - A U B
If the resultant data set for GenSyncClient and GenSyncServer is as expected, the test passes, else the test fails.
Looks right to me!
On Jun 19, 2020, at 8:34 AM, 6/19/20, Shubham Arora notifications@github.com wrote:
I have written here semi-formally how syncTest is expected to behave:
For all syncs that implement GenSync, syncTest tests that the following guarantees hold:
Let Peer P1 be client with data - set A : GenSyncClient and Peer P2 be server with data - set B : GenSyncServer
Now, GenSyncClient synchroizes using GenSync :: clientSyncBegin, and GenSyncServer synchroizes using GenSync :: serverSyncBegin
At the end, GenSyncServer data is modified. The server is now expected to have the data - set A U B. For "one-way" syncs, the client should be unchanged, else the client is also modified to contain data - A U B
If the resultant data set for GenSyncClient and GenSyncServer is as expected, the test passes, else the test fails.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/trachten/cpisync/issues/48#issuecomment-646611189, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACM5LU46ZI6XSFJJIILRILLRXNLMHANCNFSM4MFDJLHQ.
Ari Trachtenberg, Boston University http://people.bu.edu/trachten mailto:trachten@bu.edu
Random quote of the day:
A day without sunshine is like, night.
SyncTest function when used with GenSync over CommSocket forks two pairs of
GenSyncClient, GenSyncServer
. Both pairs reconcile over the same socket. Since one of the pairs must finish first, the one behind fails to close the socket. It's already closed by that time.I tried to depict the scenario (the socket is in blue):
The bug can easily be reproduced by running
IBLTSyncTest
orCuckooSyncTest
withDEFAULT_LOGLEVEL=METHOD
.That prints the message
Attempted closing of socket that is not connected to anything.
fromCommSocket::commClose()
.The first pair of
GenSyncClient, GenSyncServer
closes the socket when done and setsCommSocket::my_fd
to-1
, the trailing pair ofGenSyncClient, GenSyncServer
fails to close the socket becauseCommSocket::my_fd == -1
by that time.