[SERVER-5724] dbtemprelease's destructor can fail to restore state and assert on failure Created: 30/Apr/12 Updated: 11/Jul/16 Resolved: 29/Oct/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Concurrency |
| Affects Version/s: | None |
| Fix Version/s: | 2.5.5 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Aaron Staple | Assignee: | Andy Schwerin |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Linked BF Score: | 0 | ||||||||||||||||||||
| Description |
|
Currently dbtemprelease's destructor attempts to acquire the same lock type as was yielded and restore the thread's client context to its pre yield state. If the lock is a read lock and the context's namespace belongs to a database that was closed during the yield, restoring the context will fail and dbtemprelease's destructor will assert. Asserting in dbtemprelease's destructor seems particularly unsafe because as a raii class its destructor is designed to be called when another exception is active. There seems to be a way to detect an active stack unwinding exception in a destructor, but it may be unreliable and there is no way to replace this exception with a higher priority exception about an inability to recover the thread's client context. Provisionally two options for dealing with this are:
See |
| Comments |
| Comment by Githook User [ 30/Jan/14 ] |
|
Author: {u'username': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}Message: destructors as throwing This is a stop-gap solution to prevent c++11 builds from terminating when For similar reasons it is invalid to put dbtemprelease into a smart pointer dbtemprelasewritelock is unused so it was removed rather than fixed. |
| Comment by Andy Schwerin [ 22/May/12 ] |
|
Further problem is appropriately invalidating parent contexts. Blech. |