summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2021-05-06 17:55:46 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-07-26 21:11:27 +0000
commit8ff8a14216bef7f7d6fd7720a9727886f529e287 (patch)
treef1166b79cd5be6632b35d099f9d80fb2877a46e4
parent1dad9ea8f8bf6d7adcb4ee14d18c1074a11ec576 (diff)
downloadmongo-8ff8a14216bef7f7d6fd7720a9727886f529e287.tar.gz
SERVER-56676 TTLMonitor handles NaN/out of range values when extracting expireAfterSeconds
(cherry picked from commit daa37e38c73b0eed3ef91d7156e71f7aa6028e42)
-rw-r--r--src/mongo/db/ttl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/db/ttl.cpp b/src/mongo/db/ttl.cpp
index a3e872d5288..9566898ac72 100644
--- a/src/mongo/db/ttl.cpp
+++ b/src/mongo/db/ttl.cpp
@@ -296,7 +296,7 @@ private:
const Date_t kDawnOfTime =
Date_t::fromMillisSinceEpoch(std::numeric_limits<long long>::min());
- const Date_t expirationTime = Date_t::now() - Seconds(secondsExpireElt.numberLong());
+ const Date_t expirationTime = Date_t::now() - Seconds(secondsExpireElt.safeNumberLong());
const BSONObj startKey = BSON("" << kDawnOfTime);
const BSONObj endKey = BSON("" << expirationTime);
// The canonical check as to whether a key pattern element is "ascending" or