[SERVER-28483] assert.soonNoExcept should not print stack traces intermitently Created: 24/Mar/17  Updated: 14/Apr/17  Resolved: 14/Apr/17

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Judah Schvimer Assignee: Judah Schvimer
Resolution: Won't Fix Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Participants:
Linked BF Score: 0

 Description   

assert.soonNoExcept expects exceptions to occur. The stack traces it prints are not very helpful outside of the very last one, and can be misleading and alarming.

Example:

	
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.417+0000 caught exception Error: [null] != [{ "_id" : ObjectId("58cc40145f421e75d6272d0d"), "a" : 2 }] are not equal : Node ip-10-178-217-67:20260 contained op that should have been rolled back
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.627+0000 assert: [null] != [{ "_id" : ObjectId("58cc40145f421e75d6272d0d"), "a" : 2 }] are not equal : Node ip-10-178-217-67:20260 contained op that should have been rolled back
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.627+0000 doassert@src/mongo/shell/assert.js:18:14
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.628+0000 assert.eq@src/mongo/shell/assert.js:54:5
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.628+0000 @jstests/replsets/write_concern_after_stepdown_and_stepup.js:104:1
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.628+0000 @jstests/replsets/write_concern_after_stepdown_and_stepup.js:103:9
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.628+0000 _convertExceptionToReturnStatus@src/mongo/shell/assert.js:218:20
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.628+0000 assert.soonNoExcept/<@src/mongo/shell/assert.js:225:24
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.628+0000 assert.soon@src/mongo/shell/assert.js:196:17
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.629+0000 assert.soonNoExcept@src/mongo/shell/assert.js:225:5
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.629+0000 @jstests/replsets/write_concern_after_stepdown_and_stepup.js:102:5
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.629+0000 @jstests/replsets/write_concern_after_stepdown_and_stepup.js:6:2
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.629+0000 
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.629+0000 caught exception Error: [null] != [{ "_id" : ObjectId("58cc40145f421e75d6272d0d"), "a" : 2 }] are not equal : Node ip-10-178-217-67:20260 contained op that should have been rolled back
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.832+0000 assert: [null] != [{ "_id" : ObjectId("58cc40145f421e75d6272d0d"), "a" : 2 }] are not equal : Node ip-10-178-217-67:20260 contained op that should have been rolled back
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.832+0000 doassert@src/mongo/shell/assert.js:18:14
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.832+0000 assert.eq@src/mongo/shell/assert.js:54:5
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.832+0000 @jstests/replsets/write_concern_after_stepdown_and_stepup.js:104:1
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.832+0000 @jstests/replsets/write_concern_after_stepdown_and_stepup.js:103:9
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.833+0000 _convertExceptionToReturnStatus@src/mongo/shell/assert.js:218:20
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.833+0000 assert.soonNoExcept/<@src/mongo/shell/assert.js:225:24
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.833+0000 assert.soon@src/mongo/shell/assert.js:196:17
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.833+0000 assert.soonNoExcept@src/mongo/shell/assert.js:225:5
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.833+0000 @jstests/replsets/write_concern_after_stepdown_and_stepup.js:102:5
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.833+0000 @jstests/replsets/write_concern_after_stepdown_and_stepup.js:6:2
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.833+0000 
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.834+0000 caught exception Error: [null] != [{ "_id" : ObjectId("58cc40145f421e75d6272d0d"), "a" : 2 }] are not equal : Node ip-10-178-217-67:20260 contained op that should have been rolled back
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.834+0000 assert.soon failed: () => _convertExceptionToReturnStatus(func)
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.834+0000 doassert@src/mongo/shell/assert.js:18:14
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.834+0000 assert.soon@src/mongo/shell/assert.js:202:13
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.834+0000 assert.soonNoExcept@src/mongo/shell/assert.js:225:5
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.834+0000 @jstests/replsets/write_concern_after_stepdown_and_stepup.js:102:5
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.835+0000 @jstests/replsets/write_concern_after_stepdown_and_stepup.js:6:2
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.835+0000 
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.835+0000 2017-03-17T20:04:36.831+0000 E QUERY    [thread1] Error: assert.soon failed: () => _convertExceptionToReturnStatus(func) :
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.835+0000 doassert@src/mongo/shell/assert.js:18:14
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.835+0000 assert.soon@src/mongo/shell/assert.js:202:13
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.835+0000 assert.soonNoExcept@src/mongo/shell/assert.js:225:5
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.836+0000 @jstests/replsets/write_concern_after_stepdown_and_stepup.js:102:5
[js_test:write_concern_after_stepdown_and_stepup] 2017-03-17T20:04:36.836+0000 @jstests/replsets/write_concern_after_stepdown_and_stepup.js:6:2



 Comments   
Comment by Judah Schvimer [ 14/Apr/17 ]

After looking at the code, assert.soonNoExcept is not printing the stack trace, the underlying assert that throws the exception is, so there is nothing we can do in general for this.

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