diff options
author | Gregory Wlodarek <gregory.wlodarek@mongodb.com> | 2019-06-11 15:28:37 -0400 |
---|---|---|
committer | Gregory Wlodarek <gregory.wlodarek@mongodb.com> | 2019-06-11 15:28:37 -0400 |
commit | 951f7a2c184af7c5d46945b56dcfbc13fd3c5197 (patch) | |
tree | 484783677e35a44eae5ed6903880f40c7b0fc336 /src/mongo/db/matcher | |
parent | 01a945fc58986f25ebf51d2436f75e140ca16aa1 (diff) | |
download | mongo-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.cpp | 7 |
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)) { |