]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc/Objecter: upper bound watch_check result 8967/head
authorSage Weil <sage@redhat.com>
Fri, 6 May 2016 13:09:43 +0000 (09:09 -0400)
committerSage Weil <sage@redhat.com>
Fri, 6 May 2016 13:09:43 +0000 (09:09 -0400)
This way we always return a safe upper bound on the amount of time
since we did a check.  Among other things, this prevents us from
returning a value of 0, which is confusing.

Fixes: http://tracker.ceph.com/issues/15760
Signed-off-by: Sage Weil <sage@redhat.com>
src/osdc/Objecter.cc

index 4221ba60be4872fe20dd4be4decc10b27f513052..2d62779a413af64558a2f6787a557d3b8eb80cc5 100644 (file)
@@ -706,7 +706,9 @@ int Objecter::linger_check(LingerOp *info)
                 << " age " << age << dendl;
   if (info->last_error)
     return info->last_error;
-  return std::chrono::duration_cast<std::chrono::milliseconds>(age).count();
+  // return a safe upper bound (we are truncating to ms)
+  return
+    1 + std::chrono::duration_cast<std::chrono::milliseconds>(age).count();
 }
 
 void Objecter::linger_cancel(LingerOp *info)