[SERVER-30875] Add support for a "no-owned bson" mode for JS Scopes Created: 29/Aug/17  Updated: 30/Oct/23  Resolved: 30/Aug/17

Status: Closed
Project: Core Server
Component/s: JavaScript
Affects Version/s: None
Fix Version/s: 3.2.17, 3.4.9, 3.5.13

Type: New Feature Priority: Major - P3
Reporter: Mira Carey Assignee: Mira Carey
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Related
related to SERVER-30971 Use of "scope" field in mapReduce tri... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v3.4, v3.2, v3.0
Sprint: Platforms 2017-09-11
Participants:

 Description   

Currently, we rely on users of the JS layer to always mark objects as owned, or call advanceGeneration as needed to invalidate view-only types. We should add a mode to the scope which enforces ownership to prevent unowned objects from being passed in if we're not expecting them



 Comments   
Comment by Githook User [ 31/Aug/17 ]

Author:

{'username': 'hanumantmk', 'name': 'Jason Carey', 'email': 'jcarey@argv.me'}

Message: SERVER-30875 add requireOwnedObjects() to scope

Add a flag to JS scopes that requires that bson objects bound to the
scope be owned. This should allow for more easy auditing of scopes that
don't explicitly manage lifetime with advanceGeneration.

(cherry picked from commit 79b47945a6aae707d44e05669d991d86b157a14b)
Branch: v3.2
https://github.com/mongodb/mongo/commit/1abb660e076004f16aa1b253ab16c586209b1804

Comment by Githook User [ 30/Aug/17 ]

Author:

{'username': 'hanumantmk', 'email': 'jcarey@argv.me', 'name': 'Jason Carey'}

Message: SERVER-30875 add requireOwnedObjects() to scope

Add a flag to JS scopes that requires that bson objects bound to the
scope be owned. This should allow for more easy auditing of scopes that
don't explicitly manage lifetime with advanceGeneration.

(cherry picked from commit 79b47945a6aae707d44e05669d991d86b157a14b)
Branch: v3.4
https://github.com/mongodb/mongo/commit/8ef456f89f63ab12941fe6b5352b20cff2522da3

Comment by Githook User [ 30/Aug/17 ]

Author:

{'name': 'Jason Carey', 'username': 'hanumantmk', 'email': 'jcarey@argv.me'}

Message: SERVER-30875 add requireOwnedObjects() to scope

Add a flag to JS scopes that requires that bson objects bound to the
scope be owned. This should allow for more easy auditing of scopes that
don't explicitly manage lifetime with advanceGeneration.
Branch: master
https://github.com/mongodb/mongo/commit/79b47945a6aae707d44e05669d991d86b157a14b

Generated at Thu Feb 08 04:25:18 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.