Cancelling the sync deferred should stop the sync process
Currently, bitmask client has a timeout set for the first soledad sync. After this timeout, bitmask client calls the @cancel()@ method of the @Deferred@ returned by the call to @Soledad.sync()@, which should succesfully interrupt the sync process.
The interruption of the sync process is currently not working, and cancelling the deferred will cause 2 concurrent sync processes to be called at the same time:
[2015-08-13 13:30:13] DEBUG - L#618 : leap.bitmask.services.soledad.soledadbootstrapper:_try_sync - BOOTSTRAPPER: trying to sync Soledad.... [2015-08-13 13:30:13] INFO - L#109 : twisted.logger._stdlib:__call__ - Starting factory [2015-08-13 13:30:17] DEBUG - L#84 : leap.soledad.client.sync:sync - Soledad target sync info: target replica uid: d954a1a3223348f2b59a4c257a7d9b90 target generation: 9259 target trans id: T-d4b106cf64e74ada92e3fe13a65cce86 target my gen: 8915 target my trans_id: T-e8023ad80f694a0c9aeaec1882702fdc source replica_uid: de4eaca00658440e8578bb3358a2ad88 [2015-08-13 13:30:17] DEBUG - L#103 : leap.soledad.client.sync:sync - Soledad sync: there are 307 documents to send. [2015-08-13 13:30:17] DEBUG - L#116 : leap.soledad.client.sync:sync - Soledad source sync info: last target gen known to source: 6944 last target trans_id known to source: T-56425a925db54abc897e72617855a229 [2015-08-13 13:30:25] DEBUG - L#317 : leap.soledad.client.http_target:_send_docs - Sync send status: 1/307 [2015-08-13 13:30:25] DEBUG - L#365 : leap.soledad.client.pragmas:set_write_ahead_logging - SQLCIPHER: SETTING WRITE-AHEAD LOGGING [2015-08-13 13:30:25] DEBUG - L#332 : leap.soledad.client.pragmas:set_synchronous_normal - SQLCIPHER: SETTING SYNCHRONOUS NORMAL [2015-08-13 13:30:33] DEBUG - L#317 : leap.soledad.client.http_target:_send_docs - Sync send status: 2/307 [2015-08-13 13:30:33] DEBUG - L#365 : leap.soledad.client.pragmas:set_write_ahead_logging - SQLCIPHER: SETTING WRITE-AHEAD LOGGING [2015-08-13 13:30:33] DEBUG - L#332 : leap.soledad.client.pragmas:set_synchronous_normal - SQLCIPHER: SETTING SYNCHRONOUS NORMAL [2015-08-13 13:30:42] DEBUG - L#317 : leap.soledad.client.http_target:_send_docs - Sync send status: 3/307 [2015-08-13 13:30:42] DEBUG - L#365 : leap.soledad.client.pragmas:set_write_ahead_logging - SQLCIPHER: SETTING WRITE-AHEAD LOGGING [2015-08-13 13:30:42] DEBUG - L#332 : leap.soledad.client.pragmas:set_synchronous_normal - SQLCIPHER: SETTING SYNCHRONOUS NORMAL [2015-08-13 13:30:43] ERROR - L#699 : leap.soledad.client.api:_sync_errback - Soledad exception when syncing! *--- Failure #10 --- Failure: twisted.internet.defer.CancelledError: *--- End of Failure #10 --- [2015-08-13 13:30:43] INFO - L#109 : twisted.logger._stdlib:__call__ - Starting factory [2015-08-13 13:30:47] DEBUG - L#84 : leap.soledad.client.sync:sync - Soledad target sync info: target replica uid: d954a1a3223348f2b59a4c257a7d9b90 target generation: 9262 target trans id: T-c350823f73c340d0b82327217f7202ae target my gen: 8918 target my trans_id: T-7bec5510fa86459da65669a7fb53099f source replica_uid: de4eaca00658440e8578bb3358a2ad88 [2015-08-13 13:30:47] DEBUG - L#103 : leap.soledad.client.sync:sync - Soledad sync: there are 304 documents to send. [2015-08-13 13:30:47] DEBUG - L#116 : leap.soledad.client.sync:sync - Soledad source sync info: last target gen known to source: 6944 last target trans_id known to source: T-56425a925db54abc897e72617855a229 [2015-08-13 13:30:51] DEBUG - L#317 : leap.soledad.client.http_target:_send_docs - Sync send status: 4/307 [2015-08-13 13:30:58] DEBUG - L#317 : leap.soledad.client.http_target:_send_docs - Sync send status: 1/304
(from redmine: created on 2015-08-13, closed on 2016-03-31)