summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2017-05-12 16:57:29 -0400
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2017-05-17 09:08:11 -0400
commit4dbab2657ec28f71da0e97c2d2f9be8df4e54e70 (patch)
tree98bae3ec204662549d9acfa5087dbf5325b41515
parent4db4a7cc7d73c77feb7e5d7c81533c026296f54c (diff)
downloadmongo-4dbab2657ec28f71da0e97c2d2f9be8df4e54e70.tar.gz
SERVER-29164 Ensure CatalogCache::getCollectionRoutingInfo does not throw
(cherry picked from commit ff3177abf366f0699629afb1b20fb72c6c79a6e4)
-rw-r--r--src/mongo/s/catalog_cache.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mongo/s/catalog_cache.cpp b/src/mongo/s/catalog_cache.cpp
index 36d5e82ac49..103a69550a2 100644
--- a/src/mongo/s/catalog_cache.cpp
+++ b/src/mongo/s/catalog_cache.cpp
@@ -212,7 +212,14 @@ StatusWith<CachedCollectionRoutingInfo> CatalogCache::getCollectionRoutingInfo(
// Wait on the notification outside of the mutex
ul.unlock();
- auto refreshStatus = refreshNotification->get(opCtx);
+ auto refreshStatus = [&]() {
+ try {
+ return refreshNotification->get(opCtx);
+ } catch (const DBException& ex) {
+ return ex.toStatus();
+ }
+ }();
+
if (!refreshStatus.isOK()) {
return refreshStatus;
}