Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-7272

improve BackgroundLeaseUpdate warning messages

    XMLWordPrintableJSON

Details

    Description

      Example for current logging:

      *WARN* [DocumentNodeStore lease update thread (1)] org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore BackgroundLeaseUpdate.execute: time since last renewClusterIdLease() call longer than expected: 5338ms
      

      Source:

              @Override
              protected void execute(@Nonnull DocumentNodeStore nodeStore) {
                  // OAK-4859 : keep track of invocation time of renewClusterIdLease
                  // and warn if time since last call is longer than 5sec
                  final long now = System.currentTimeMillis();
                  if (lastRenewClusterIdLeaseCall <= 0) {
                      lastRenewClusterIdLeaseCall = now;
                  } else {
                      final long diff = now - lastRenewClusterIdLeaseCall;
                      if (diff > 5000) {
                          LOG.warn("BackgroundLeaseUpdate.execute: time since last renewClusterIdLease() call longer than expected: {}ms", diff);
                      }
                      lastRenewClusterIdLeaseCall = now;
                  }
                  // first renew the clusterId lease
                  nodeStore.renewClusterIdLease();
              }
      

      Observations:

      • the warning message doesn't actually say what the expected delay is
      • we only log when it's exceeded by factor 5
      • the threshold is hardwired; it should be computed based on the actual config (I think)

      Also:

      • we don't measure the time of the actual update operation, so we don't know whether it's a thread scheduling problem or a persistence problem (again, I think)

      stefanegli, mreutegg - feedback appreciated.

      Attachments

        1. OAK-7272.diff
          3 kB
          Julian Reschke
        2. OAK-7272.diff
          3 kB
          Julian Reschke

        Issue Links

          Activity

            People

              reschke Julian Reschke
              reschke Julian Reschke
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: