[SERVER-35160] ScopedThreads should automatically inherit TestData from their parent thread Created: 22/May/18  Updated: 29/Oct/23  Resolved: 11/Sep/18

Status: Closed
Project: Core Server
Component/s: Shell, Testing Infrastructure
Affects Version/s: None
Fix Version/s: 4.1.3

Type: Improvement Priority: Major - P3
Reporter: Spencer Brody (Inactive) Assignee: Jonathan Abrahams
Resolution: Fixed Votes: 0
Labels: tig-qwin-eligible
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-35154 Exceptions that escape a ScopedThread... Closed
Backwards Compatibility: Fully Compatible
Sprint: TIG 2018-09-10
Participants:
Story Points: 2

 Description   

For a test that uses ScopedThread to pass in the auth passthrough tests, the test author needs to remember to manually pass TestData into the spawned thread so it can inherit the proper auth credentials. startParallelShell automatically copies the TestData to the new shell, ScopedThread should behave the same.



 Comments   
Comment by Githook User [ 11/Sep/18 ]

Author:

{'name': 'Max Hirschhorn', 'email': 'max.hirschhorn@mongodb.com', 'username': 'visemet'}

Message: SERVER-35160 Allow TestData to be undefined in worker_thread.js again.

The global TestData object is `undefined` when the backup_restore*.js
tests run FSM workloads against their own replica set.

This partially reverts some of the changes to worker_thread.js from
fdf3ac3da53134ffac8f3d51a8faa49479daec44.
Branch: master
https://github.com/mongodb/mongo/commit/f45a68e589850bbf43c9d656bbbffa0d6b1efc79

Comment by Max Hirschhorn [ 10/Sep/18 ]

I'm reopening this ticket because milkie has pointed out that the worker threads started by the concurrency framework are failing due to the global TestData object being undefined. The "Too many worker threads failed to spawn - aborting" exception gets swallowed because it isn't a TypeError or ReferenceError.

[js_test:backup_restore_stop_start] 2018-09-05T20:07:54.672+0000 sh4057| 2018-09-05T20:07:54.672+0000 I QUERY    [thread8] js thread raised js exception: JSInterpreterFailure: TypeError: TestData is undefined :
[js_test:backup_restore_stop_start] 2018-09-05T20:07:54.673+0000 sh4057| main@jstests/concurrency/fsm_libs/worker_thread.js:43:1
[js_test:backup_restore_stop_start] 2018-09-05T20:07:54.673+0000 sh4057| @<unknown> line 6 > eval:7:1
[js_test:backup_restore_stop_start] 2018-09-05T20:07:54.673+0000 sh4057| @<unknown> line 6 > eval:5:24
[js_test:backup_restore_stop_start] 2018-09-05T20:07:54.673+0000 sh4057| _threadStartWrapper@:26:16
[js_test:backup_restore_stop_start] 2018-09-05T20:07:54.673+0000 sh4057| ScopedThread@jstests/libs/parallelTester.js:50:9
[js_test:backup_restore_stop_start] 2018-09-05T20:07:54.673+0000 sh4057| makeThread@jstests/concurrency/fsm_libs/thread_mgr.js:35:16
[js_test:backup_restore_stop_start] 2018-09-05T20:07:54.673+0000 sh4057| spawnAll/<@jstests/concurrency/fsm_libs/thread_mgr.js:127:25
[js_test:backup_restore_stop_start] 2018-09-05T20:07:54.673+0000 sh4057| spawnAll@jstests/concurrency/fsm_libs/thread_mgr.js:101:9
[js_test:backup_restore_stop_start] 2018-09-05T20:07:54.673+0000 sh4057| runWorkloadGroup@jstests/concurrency/fsm_libs/runner.js:567:17
[js_test:backup_restore_stop_start] 2018-09-05T20:07:54.673+0000 sh4057| runWorkloads/<@jstests/concurrency/fsm_libs/runner.js:690:1
[js_test:backup_restore_stop_start] 2018-09-05T20:07:54.674+0000 sh4057| runWorkloads@jstests/concurrency/fsm_libs/runner.js:678:13
[js_test:backup_restore_stop_start] 2018-09-05T20:07:54.674+0000 sh4057| serial@jstests/concurrency/fsm_libs/runner.js:720:1
[js_test:backup_restore_stop_start] 2018-09-05T20:07:54.674+0000 sh4057| @(shell eval):64:1
[js_test:backup_restore_stop_start] 2018-09-05T20:07:54.674+0000 sh4057| @(shell eval):63:21
[js_test:backup_restore_stop_start] 2018-09-05T20:07:54.674+0000 sh4057| @(shell eval):1:1
...
[js_test:backup_restore_stop_start] 2018-09-05T20:08:05.242+0000 sh4057| 10 thread(s) threw a JS or C++ exception while spawning

https://logkeeper.mongodb.org/lobster/build/79b4e1f0f845c7e438bcd0204009afed/test/5b90379054f2486b010cbfb6#bookmarks=0%2C827%2C15805

Comment by Githook User [ 05/Sep/18 ]

Author:

{'name': 'Jonathan Abrahams', 'email': 'jonathan@mongodb.com', 'username': 'hptabster'}

Message: SERVER-35160 ScopedThreads should automatically inherit TestData from their parent thread
Branch: master
https://github.com/mongodb/mongo/commit/fdf3ac3da53134ffac8f3d51a8faa49479daec44

Comment by Spencer Brody (Inactive) [ 22/May/18 ]

If this worked it would have avoided the need for this hotfix to unbreak the build: https://github.com/mongodb/mongo/commit/abb1b353648260175c3dfe02ac8ae54c083956f7

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