[SERVER-5485] implement thread safety for shell utils, using fine grained locking Created: 03/Apr/12 Updated: 11/Jul/16 Resolved: 08/Jun/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | JavaScript, Shell |
| Affects Version/s: | None |
| Fix Version/s: | 2.1.2 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Ian Whalen (Inactive) | Assignee: | Tad Marshall |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Linux 64-bit v8, need to see if Windows V8 has issues |
||
| Issue Links: |
|
||||||||||||||||
| Operating System: | ALL | ||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
http://buildbot.mongodb.org/builders/Linux%2064-bit%20v8/builds/3256/steps/test_11/logs/stdio |
| Comments |
| Comment by Tad Marshall [ 08/Jun/12 ] |
|
Created |
| Comment by Tad Marshall [ 08/Jun/12 ] |
|
I spent some time looking at the code and there was nothing obvious that needed to be done beyond what Aaron has already done. Then I started to try to reproduce the original problem and realized that this only affects the V8 build. Since we're not supporting V8 for version 2.2, the follow-up on this ticket can be postponed until V8 moves up in the queue. Postponing to 2.3 desired for now. |
| Comment by auto [ 11/Apr/12 ] |
|
Author: {u'login': u'tadmarshall', u'name': u'Tad Marshall', u'email': u'tad@10gen.com'}Message: |
| Comment by auto [ 11/Apr/12 ] |
|
Author: {u'login': u'astaple', u'name': u'Aaron', u'email': u'aaron@10gen.com'}Message: |
| Comment by auto [ 11/Apr/12 ] |
|
Author: {u'login': u'astaple', u'name': u'Aaron', u'email': u'aaron@10gen.com'}Message: |
| Comment by auto [ 11/Apr/12 ] |
|
Author: {u'login': u'astaple', u'name': u'Aaron', u'email': u'aaron@10gen.com'}Message: |
| Comment by auto [ 11/Apr/12 ] |
|
Author: {u'login': u'astaple', u'name': u'Aaron', u'email': u'aaron@10gen.com'}Message: |
| Comment by Eliot Horowitz (Inactive) [ 05/Apr/12 ] |
|
Yes - definitely needs to be finer grained. |
| Comment by Aaron Staple [ 05/Apr/12 ] |
|
I think previously we had a pretty broad lock (which has been removed from the code) that we yielded for things like network io and sleeping. But if we want to move to more fine grained locking I can implement that. |
| Comment by Eliot Horowitz (Inactive) [ 04/Apr/12 ] |
|
aaron - with multi threaded v8 the shell helpers need to be thread safe. in this case, the process management code you wrote a while back is just completely not thread safe. definitely don't want a big lock around it. |
| Comment by Antoine Girbal [ 04/Apr/12 ] |
|
most native functions called from JS should already be thread safe. |
| Comment by Aaron Staple [ 03/Apr/12 ] |
|
@antoine - Is this related to removal of the js callback mutex, and do we have a general plan for dealing with issues like this? (Would it be acceptable, provided it's correct, to use a single mutex to lock all the shell utils functions for example?) @andy - If you know the answer to this, could you confirm on mutex granularity. |
| Comment by Andy Schwerin [ 03/Apr/12 ] |
|
Looks like a classic "need a mutex to guard a shared object" bug around "dbs" in shell_utils.cpp. Pretty much any native function callable from javascript needs to be threadsafe. |