summaryrefslogtreecommitdiff
path: root/src/mongo/db/matcher
diff options
context:
space:
mode:
authorGregory Wlodarek <gregory.wlodarek@mongodb.com>2019-06-11 15:28:37 -0400
committerGregory Wlodarek <gregory.wlodarek@mongodb.com>2019-06-11 15:28:37 -0400
commit951f7a2c184af7c5d46945b56dcfbc13fd3c5197 (patch)
tree484783677e35a44eae5ed6903880f40c7b0fc336 /src/mongo/db/matcher
parent01a945fc58986f25ebf51d2436f75e140ca16aa1 (diff)
downloadmongo-951f7a2c184af7c5d46945b56dcfbc13fd3c5197.tar.gz
Revert "SERVER-41065 Make evaluate() thread safe by passing 'Variables' as a parameter"
This reverts commit 17cdb38b6db716dc47485a60ddff3c543e713e3d.
Diffstat (limited to 'src/mongo/db/matcher')
-rw-r--r--src/mongo/db/matcher/expression_expr.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/mongo/db/matcher/expression_expr.cpp b/src/mongo/db/matcher/expression_expr.cpp
index f356c4aa25b..f58c1c14ef8 100644
--- a/src/mongo/db/matcher/expression_expr.cpp
+++ b/src/mongo/db/matcher/expression_expr.cpp
@@ -53,13 +53,8 @@ bool ExprMatchExpression::matches(const MatchableDocument* doc, MatchDetails* de
}
Document document(doc->toBSON());
-
- // 'Variables' is not thread safe, and ExprMatchExpression may be used in a validator which
- // processes documents from multiple threads simultaneously. Hence we make a copy of the
- // 'Variables' object per-caller.
- Variables variables = _expCtx->variables;
try {
- auto value = _expression->evaluate(document, &variables);
+ auto value = _expression->evaluate(document);
return value.coerceToBool();
} catch (const DBException&) {
if (MONGO_FAIL_POINT(ExprMatchExpressionMatchesReturnsFalseOnException)) {