[SERVER-46613] Only register/deregister opCtx with the Scope during reattach/detach Created: 04/Mar/20 Updated: 27/Oct/23 Resolved: 19/Mar/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | James Wahlin | Assignee: | David Percy |
| Resolution: | Gone away | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Sprint: | Query 2020-03-23 |
| Participants: |
| Description |
|
Currently, every time we call a JS function on a Scope, the Scope reregisters itself on the OperationContext, and then deregisters itself before returning. In a typical query this might happen many times on the same OperationContext. It seems like it would be simpler to only register/deregister once. We have a similar mechanism already, called reattachToOperationContext() / detachFromOperationContext(), so let's try using that hook to register and deregister the Scope as well. |
| Comments |
| Comment by David Percy [ 19/Mar/20 ] |
|
The original motivation for this ticket was to call register/unregister once per opCtx, rather than once per callFunction. We ended up fixing this as part of |