[SERVER-36978] TaskRunner must ensure Client is initialized for thread before running tasks Created: 04/Sep/18 Updated: 29/Oct/23 Resolved: 21/Sep/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication |
| Affects Version/s: | 3.4.16, 3.6.7, 4.0.2, 4.1.2 |
| Fix Version/s: | 3.4.18, 3.6.9, 4.0.4, 4.1.4 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Tess Avitabile (Inactive) | Assignee: | Tess Avitabile (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Backport Requested: |
v4.0, v3.6, v3.4
|
||||||||
| Sprint: | Repl 2018-09-24 | ||||||||
| Participants: | |||||||||
| Linked BF Score: | 46 | ||||||||
| Description |
|
If TaskRunner::_runTasks() neverĀ runs the body of this loop (for example, due to a shutdown request), then it will never initialize the Client for the thread. Then, when it cancels tasks, it there will be no Client set on the thread. This means it will be illegal for the task to call Client::cc(). TaskRunner::_runTasks() should ensure the Client is initialized before running runSingleTask(). |
| Comments |
| Comment by Githook User [ 05/Oct/18 ] |
|
Author: {'name': 'Tess Avitabile', 'email': 'tess.avitabile@mongodb.com', 'username': 'tessavitabile'}Message: (cherry picked from commit fb4e163ff4a8ce5057b66b24f41f1bf193e2058c) |
| Comment by Githook User [ 05/Oct/18 ] |
|
Author: {'name': 'Tess Avitabile', 'email': 'tess.avitabile@mongodb.com', 'username': 'tessavitabile'}Message: (cherry picked from commit fb4e163ff4a8ce5057b66b24f41f1bf193e2058c) |
| Comment by Githook User [ 05/Oct/18 ] |
|
Author: {'name': 'Tess Avitabile', 'email': 'tess.avitabile@mongodb.com', 'username': 'tessavitabile'}Message: (cherry picked from commit fb4e163ff4a8ce5057b66b24f41f1bf193e2058c) |
| Comment by Githook User [ 21/Sep/18 ] |
|
Author: {'name': 'Tess Avitabile', 'email': 'tess.avitabile@mongodb.com', 'username': 'tessavitabile'}Message: |
| Comment by Tess Avitabile (Inactive) [ 18/Sep/18 ] |
|
benety.goh, do you know why the task runner initializes the client and opCtx only as neededĀ here instead of always initializing them here? I would like to change the task runner to always initialize the client and opCtx, but I'm not sure if there is a reason not to, such as for performance. |