Project

General

Profile

Actions

Backport #25221

closed

luminous: common: Cond.h:C_SaferCond does not check done before calling cond.WaitInterval, creating a race condition

Added by Nathan Cutler over 5 years ago. Updated about 3 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Target version:
-
Release:
luminous
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Related issues 1 (0 open1 closed)

Copied from Ceph - Bug #25007: common: Cond.h:C_SaferCond does not check done before calling cond.WaitInterval, creating a race conditionResolvedPatrick Donnelly

Actions
Actions #1

Updated by Nathan Cutler over 5 years ago

  • Copied from Bug #25007: common: Cond.h:C_SaferCond does not check done before calling cond.WaitInterval, creating a race condition added
Actions #2

Updated by Prashant D over 5 years ago

  • Status changed from New to Need More Info
  • Assignee set to Prashant D

Should we add wait_for to backport 25007 changes to luminous ?

$ git diff
diff --cc src/common/Cond.h
index aa53b60f23,949f293343..0000000000
--- a/src/common/Cond.h
++ b/src/common/Cond.h
@ -194,6 -195,18 +194,21 @ public
cond.Wait(lock);
return rval;
}
+<<<<<<< HEAD
+=======

+ /// Wait until the \c secs expires or \c complete() is called
+ int wait_for(double secs) {
+ utime_t interval;
+ interval.set_from_double(secs);
+ Mutex::Locker l{lock};
+ if (done) {
+ return rval;
+ }
+ cond.WaitInterval(lock, interval);
+ return done ? rval : ETIMEDOUT;
+ }
++>>>>>>> 7090ea24dd... common: check completion condition before waiting
};

Actions #3

Updated by Nathan Cutler about 3 years ago

  • Assignee deleted (Prashant D)
Actions #4

Updated by Nathan Cutler about 3 years ago

  • Status changed from Need More Info to Rejected
Actions

Also available in: Atom PDF