[SERVER-34798] Replace subclasses of ServiceContext with decorations and flexible initialization code Created: 02/May/18 Updated: 29/Oct/23 Resolved: 22/Jun/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | None |
| Fix Version/s: | 4.0.3, 4.1.1 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Andy Schwerin | Assignee: | Andy Schwerin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||
| Backport Requested: |
v4.0, v3.6
|
||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||
| Linked BF Score: | 61 | ||||||||||||||||||||||||||||
| Description |
|
The code in the subclasses of ServiceContext could be easily moved into a single, separate library of global free functions that operate on instances of ServiceContext. This would allow us to get rid of the various subclasses of ServiceContext, allowing us to simplify testing infrastructure. |
| Comments |
| Comment by Githook User [ 05/Nov/19 ] |
|
Author: {'username': 'bcaimano', 'email': 'ben.caimano@mongodb.com', 'name': 'Ben Caimano'}Message: This commit is only on v3.6 as an alternative to a full backport of |
| Comment by Githook User [ 13/Sep/18 ] |
|
Author: {'name': 'Henrik Edin', 'email': 'henrik.edin@mongodb.com', 'username': 'henrikedin'}Message: This patch does several loosely related and surprisingly hard to separate things. 1.) Make the ServiceContext class final 2.) Create a mechanism, called ConstructorActions, for running methods on 3.) Introduce / improve test fixture base classes for tests, giving them fresh 4.) Make several remaining global variables SC decorations in support of (3) 5.) Replace many MONGO_INITIALIZERS that access getGlobalServiceContext with the 6.) Fix up tests to use the fixtures from (3) and fix tests that silently used 7.) Utilize (2) as necessary to simplify initialization of new ServiceContexts, (cherry picked from commit d520be0814492c262515cf0a5d62a127ace70dce)
(cherry picked from commit 9a68eb0cc65a93233b4ff5746330f9eb77de9b90)
(cherry picked from commit bfe170e49b1dc10b2badde45bc13c057a2f8ab61)
(cherry picked from commit b079e4713d897b5541c2804386025817ec720800)
(cherry picked from commit 4c16f0f336f4db77034e8aa594bbd4a5bac3f40c)
(cherry picked from commit c9d4204b6243e5eee6fe0b5e2c34d02af9ac5edb) |
| Comment by Githook User [ 13/Sep/18 ] |
|
Author: {'name': 'Henrik Edin', 'email': 'henrik.edin@mongodb.com', 'username': 'henrikedin'}Message: (cherry picked from commit 7ba144c6d0e28282e47450634ca5370b270e3207)
(cherry picked from commit f9e131ad70d3103513e777cb2125daa1daae23ec) |
| Comment by Andy Schwerin [ 22/Jun/18 ] |
|
Consider back port of this change to 4.0 branch to simplify other back ports. |
| Comment by Githook User [ 22/Jun/18 ] |
|
Author: {'username': 'amschwerin', 'name': 'Andy Schwerin', 'email': 'schwerin@mongodb.com'}Message: This patch does several loosely related and surprisingly hard to separate things. 1.) Make the ServiceContext class final 2.) Create a mechanism, called ConstructorActions, for running methods on 3.) Introduce / improve test fixture base classes for tests, giving them fresh 4.) Make several remaining global variables SC decorations in support of (3) 5.) Replace many MONGO_INITIALIZERS that access getGlobalServiceContext with the 6.) Fix up tests to use the fixtures from (3) and fix tests that silently used 7.) Utilize (2) as necessary to simplify initialization of new ServiceContexts, |
| Comment by Githook User [ 22/Jun/18 ] |
|
Author: {'username': 'amschwerin', 'name': 'Andy Schwerin', 'email': 'schwerin@mongodb.com'}Message: |
| Comment by Githook User [ 05/May/18 ] |
|
Author: {'email': 'schwerin@mongodb.com', 'name': 'Andy Schwerin', 'username': 'amschwerin'}Message: |
| Comment by Githook User [ 05/May/18 ] |
|
Author: {'email': 'schwerin@mongodb.com', 'name': 'Andy Schwerin', 'username': 'amschwerin'}Message: |