Uploaded image for project: 'Nuxeo Drive '
  1. Nuxeo Drive
  2. NXDRIVE-180

If client clock is ahead of the server one a remote full scan will always be performed after getting change summary

    XMLWordPrintable

    Details

      Description

      Detected with SUPNXP-12039
      This is because of RemoteFilteredFileSystemClient#get_changes:

          def get_changes(self, server_binding):
              result = super(RemoteFilteredFileSystemClient, self).get_changes(
                                                                      server_binding)
              log.trace("result['hasTooManyChanges'] = %r", result['hasTooManyChanges'])
              # Need to filter the result and add filterevents
              # Force the scan of the server every time now, need to compare to last
              # date filter
              # Need to multiply the last_filter_date by 1000 as the last_sync_date
              # come from nuxeo
              log.trace("server_binding.last_filter_date = %r", server_binding.last_filter_date)
              if server_binding.last_filter_date:
                  log.trace("server_binding.last_sync_date = %r", server_binding.last_sync_date)
              if (server_binding.last_filter_date
                  and server_binding.last_sync_date < (
                                          server_binding.last_filter_date * 1000)):
                  log.trace("server_binding.last_sync_date < (server_binding.last_filter_date * 1000)"
                            " => setting result['hasTooManyChanges'] to True")
                  result['hasTooManyChanges'] = True
              return result
      

      When the client clock is ahead of the server one, server_binding.last_sync_date which is sent by the server in the change summary is always lesser than server_binding.last_filter_date which si computed client-side in Filter#add or Filter#remove:

      server_binding.last_filter_date = time()
      

      Then in Synchronizer#update_synchronize_server, as summary['hasTooManyChanges'] == True, the remote scan is performed:

      if full_scan or summary['hasTooManyChanges'] or first_pass:
          # Force remote full scan
          log.debug("Remote full scan of %s. Reasons: "
                    "forced: %r, too many changes: %r, first pass: %r",
                    server_binding.local_folder, full_scan,
                    summary['hasTooManyChanges'], first_pass)
          self.scan_remote(server_binding, session=session)
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: