Skip to content

Commit

Permalink
osdc/Objecter: upper bound watch_check result
Browse files Browse the repository at this point in the history
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>
(cherry picked from commit 2e2ce36)
  • Loading branch information
liewegas authored and Abhishek Varshney committed Jun 8, 2016
1 parent d93a90e commit f4306de
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/osdc/Objecter.cc
Expand Up @@ -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)
Expand Down

0 comments on commit f4306de

Please sign in to comment.