[CDRIVER-1922] Assertion failure in stream_not_found() after failed getmore operation Created: 16/Nov/16  Updated: 19/Dec/16  Resolved: 30/Nov/16

Status: Closed
Project: C Driver
Component/s: libmongoc
Affects Version/s: 1.5.0
Fix Version/s: 1.5.0, 1.5.1

Type: Bug Priority: Major - P3
Reporter: Jeremy Mikola Assignee: A. Jesse Jiryu Davis
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by PHPC-855 Assertion failure in stream_not_found... Closed

 Description   

PHPC has two tests for throwing an exception on a failed getmore. These tests spin up their own server with mongo-orchestration and configure the failReceivedGetmore fail point.

After upgrading from 1.5.0-rc3 to 1.5.0-rc4, both of these tests trigger an assert failure in libmongoc:

phpc/src/libmongoc/src/mongoc/mongoc-cluster.c:1470 stream_not_found(): precondition failed: error
Aborted (core dumped)
 
Termsig=6

Based on the libmongoc trace log, this assert failure happens when the mongoc_client_t is destroyed during process shutdown. Our trace logs end with:

OK: Got MongoDB\Driver\Exception\ConnectionException
===DONE===
[2016-11-16T17:03:21+00:00]     cursor: TRACE   > ENTRY: mongoc_cursor_destroy():493
[2016-11-16T17:03:21+00:00] cursor-cursorid: TRACE   > ENTRY: _mongoc_cursor_cursorid_destroy():53
[2016-11-16T17:03:21+00:00]     cursor: TRACE   > ENTRY: _mongoc_cursor_destroy():510
[2016-11-16T17:03:21+00:00]     client: TRACE   > ENTRY: _mongoc_client_kill_cursor():1608
[2016-11-16T17:03:21+00:00]    cluster: TRACE   > ENTRY: mongoc_cluster_stream_for_server():1541
[2016-11-16T17:03:21+00:00]    cluster: TRACE   > ENTRY: _mongoc_cluster_stream_for_server_description():1475
[2016-11-16T17:03:21+00:00]    cluster: TRACE   > ENTRY: mongoc_cluster_disconnect_node():1305
[2016-11-16T17:03:21+00:00]    cluster: TRACE   >  EXIT: mongoc_cluster_disconnect_node():1317
[2016-11-16T17:03:21+00:00]     mongoc: TRACE   > ENTRY: mongoc_server_description_handle_ismaster():472
[2016-11-16T17:03:21+00:00]     mongoc: TRACE   >  EXIT: mongoc_server_description_handle_ismaster():478
[2016-11-16T17:03:21+00:00]     mongoc: TRACE   > TRACE: mongoc_topology_description_handle_ismaster():1674 No transition entry to Single for Unknown
[2016-11-16T17:03:21+00:00]    cluster: TRACE   >  EXIT: _mongoc_cluster_stream_for_server_description():1507
[2016-11-16T17:03:21+00:00]    cluster: TRACE   > ENTRY: mongoc_cluster_disconnect_node():1305
[2016-11-16T17:03:21+00:00]    cluster: TRACE   >  EXIT: mongoc_cluster_disconnect_node():1317
[2016-11-16T17:03:21+00:00]     mongoc: TRACE   > ENTRY: mongoc_server_description_destroy():151
[2016-11-16T17:03:21+00:00]     mongoc: TRACE   >  EXIT: mongoc_server_description_destroy():157
[2016-11-16T17:03:21+00:00]    cluster: TRACE   >  EXIT: mongoc_cluster_stream_for_server():1563
[2016-11-16T17:03:21+00:00]     cursor: TRACE   >  EXIT: _mongoc_cursor_destroy():549
[2016-11-16T17:03:21+00:00] cursor-cursorid: TRACE   >  EXIT: _mongoc_cursor_cursorid_destroy():62
[2016-11-16T17:03:21+00:00]     cursor: TRACE   >  EXIT: mongoc_cursor_destroy():503
[2016-11-16T17:03:21+00:00]     mongoc: TRACE   > ENTRY: _mongoc_write_command_destroy():1451
[2016-11-16T17:03:21+00:00]     mongoc: TRACE   >  EXIT: _mongoc_write_command_destroy():1457
[2016-11-16T17:03:21+00:00]     mongoc: TRACE   > ENTRY: _mongoc_write_result_destroy():1481
[2016-11-16T17:03:21+00:00]     mongoc: TRACE   >  EXIT: _mongoc_write_result_destroy():1489
[2016-11-16T17:03:21+00:00]     mongoc: DEBUG   > Not destroying persistent client for Manager



 Comments   
Comment by Githook User [ 17/Dec/16 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-1922 second assert err in stream_not_found
Branch: r1.5
https://github.com/mongodb/mongo-c-driver/commit/ff6d426ebbd7c3942b8b27ad5878974348449c4a

Comment by Githook User [ 30/Nov/16 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-1922 second assert err in stream_not_found
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/593b004a2b32c373845b2e597f8aa8328ff2f7e4

Comment by Jeremy Mikola [ 28/Nov/16 ]

Are you ok waiting until Tuesday for 1.5.1 with the fix?

This isn't a blocker for us. I wouldn't bother rushing 1.5.1 just to address this, as that will likely get tagged after our own release with 1.5.0.

Comment by A. Jesse Jiryu Davis [ 28/Nov/16 ]

Let's reopen this one, it's a variation on the bug.

Are you ok waiting until Tuesday for 1.5.1 with the fix?

Comment by Jeremy Mikola [ 28/Nov/16 ]

jesse: With 1.5.0, I'm still seeing assert failures on these two tests. The point of the assertion has changed to:

src/libmongoc/src/mongoc/mongoc-topology.c:804 mongoc_topology_invalidate_server(): precondition failed: error

Should this be re-opened, or would you prefer a new issue?

Comment by Githook User [ 21/Nov/16 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-1922 assert err in stream_not_found
Branch: r1.5
https://github.com/mongodb/mongo-c-driver/commit/c0ca58774445405b913b7566bbda936067aba303

Comment by Githook User [ 21/Nov/16 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-1922 assert err in stream_not_found
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/edeea77ff754be7670f3ac4fe7885cea74687bf8

Generated at Wed Feb 07 21:13:37 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.