[SERVER-23779] Replace explicit instantiation of OperationContextImpl with cc().makeOperationContext() Created: 18/Apr/16  Updated: 25/Jan/17  Resolved: 20/Apr/16

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 3.3.5

Type: Task Priority: Major - P3
Reporter: Andy Schwerin Assignee: Andy Schwerin
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Backwards Compatibility: Fully Compatible
Sprint: Sharding 13 (04/22/16)
Participants:
Linked BF Score: 0

 Description   

Rather than instantiating OperationContextImpl directly on the stack and letting its constructor use thread-local variables to initialize itself, tests and other code needing an OperationContext should construct it from the current thread's client object, via cc().makeOperationContext(). This is more consistent with the Service/Client/Operation software architecture in place, and is what mongod and mongos user operations already do.



 Comments   
Comment by Githook User [ 20/Apr/16 ]

Author:

{u'username': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@mongodb.com'}

Message: SERVER-23779 Replace direct instantiation of OperationContextImpl with cc().makeOperationContext().

Also, make OperationContextImpl's constructor private so that it can only be
constructed via a Client.
Branch: master
https://github.com/mongodb/mongo/commit/74280dd7b600c51f01e28e137a73f61fc0d0a2a2

Comment by Eric Milkie [ 19/Apr/16 ]

Reverted as the Solaris compiler with the old toolchain did not compile successfully.

Comment by Githook User [ 19/Apr/16 ]

Author:

{u'username': u'milkie', u'name': u'Eric Milkie', u'email': u'milkie@10gen.com'}

Message: Revert "SERVER-23779 Replace direct instantiation of OperationContextImpl with cc().makeOperationContext()."

This reverts commit 0ab34aa7b9c3c48ea6cf17888620fca455284d35.
Branch: master
https://github.com/mongodb/mongo/commit/35ea899074d1bf93e78177cac1155b4471cbaa7d

Comment by Githook User [ 19/Apr/16 ]

Author:

{u'username': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@mongodb.com'}

Message: SERVER-23779 Replace direct instantiation of OperationContextImpl with cc().makeOperationContext().

Also, make OperationContextImpl's constructor private so that it can
only be constructed via a Client.
Branch: master
https://github.com/mongodb/mongo/commit/0ab34aa7b9c3c48ea6cf17888620fca455284d35

Comment by Githook User [ 18/Apr/16 ]

Author:

{u'username': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@mongodb.com'}

Message: SERVER-23779 Do not construct OperationContextImpl directly in enterprise snmp module.

Instead, make operation contexts using Client::makeOperationContext.
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/a260f5fd232ef94bb36b4a6e1f0e597efe2a8163

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