summaryrefslogtreecommitdiff
path: root/src/mongo/executor/connection_pool.h
diff options
context:
space:
mode:
authorAmirsaman Memaripour <amirsaman.memaripour@mongodb.com>2020-06-10 01:34:02 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-06-24 19:52:42 +0000
commit2aeaf35f2427a42160788955957ac6ec7c7919a0 (patch)
treeb65c0bebebfdb2f683bdc5db42363c76b1b6e90a /src/mongo/executor/connection_pool.h
parenta6a3757ad06bd52d2082d80a3d35c6f1787e35eb (diff)
downloadmongo-2aeaf35f2427a42160788955957ac6ec7c7919a0.tar.gz
SERVER-48159 Reduce the inline cost of isConnected()
Diffstat (limited to 'src/mongo/executor/connection_pool.h')
-rw-r--r--src/mongo/executor/connection_pool.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mongo/executor/connection_pool.h b/src/mongo/executor/connection_pool.h
index 5183b049647..88348a34423 100644
--- a/src/mongo/executor/connection_pool.h
+++ b/src/mongo/executor/connection_pool.h
@@ -358,6 +358,16 @@ public:
virtual bool isHealthy() = 0;
/**
+ * The implementation may choose to override this method to provide a quick check for
+ * connection health (e.g., by periodically caching the return value of the last invocation).
+ * Callers should be aware that a "true" return value does not always indicate a healthy
+ * connection.
+ */
+ virtual bool maybeHealthy() {
+ return isHealthy();
+ }
+
+ /**
* Returns the last used time point for the connection
*/
Date_t getLastUsed() const;