[CDRIVER-1423] "Stream is closed" sending large message on Windows with OpenSSL Created: 27/Jul/16  Updated: 09/Aug/16  Resolved: 09/Aug/16

Status: Closed
Project: C Driver
Component/s: libmongoc, tests, tls
Affects Version/s: 1.4.0
Fix Version/s: 1.4.0

Type: Bug Priority: Major - P3
Reporter: A. Jesse Jiryu Davis 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:
Related
related to CDRIVER-1458 Test failure in mongoc_socket check_c... Closed
is related to CDRIVER-1409 Test that topology scanner is still a... Closed
Epic Link: Native TLS and SCRAM-SHA-1

 Description   

Seen here:

https://evergreen.mongodb.com/task_log_raw/mongo_c_driver_windows_64_vs2015_openssl_integration_test_3.0_ssl_b9f5cb78c0acfd032f671816f6d485fd92fa6846_16_07_27_12_52_49/0?type=T

 [2016/07/27 09:43:40.527] Begin /Collection/large_return
 [2016/07/27 09:43:44.908] FAIL:C:\data\mci\f79732256a66040ba7a7b806f3866edd\mongo-c-driver\tests\test-mongoc-collection.c:2826  test_large_return()
 [2016/07/27 09:43:44.908]   Stream is closed
 [2016/07/27 09:43:44.908] 

 [2016/07/27 09:43:17.519] Begin /BulkOperation/upsert_huge
 [2016/07/27 09:43:21.962] FAIL:C:\data\mci\f79732256a66040ba7a7b806f3866edd\mongo-c-driver\tests\test-bulk.c:977  test_upsert_huge()
 [2016/07/27 09:43:21.962]   Stream is closed
 [2016/07/27 09:43:21.962] 



 Comments   
Comment by A. Jesse Jiryu Davis [ 09/Aug/16 ]

Reverted https://github.com/mongodb/mongo-c-driver/commit/8642ac1a6dd26cc265fbd25c35d7134a21deb0ae, this should fix the bug here.

Comment by Githook User [ 09/Aug/16 ]

Author:

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

Message: Revert "CDRIVER-1423 skip large msg tests w/ OpenSSL on Win"

This reverts commit d9b55e6ca8406544a3a13f3ee6dbf5409fec81d8.
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/cb70003e400448b24d3396fd57d958da3e24d78d

Comment by A. Jesse Jiryu Davis [ 09/Aug/16 ]

OK go for it. Let's reopen CDRIVER-1409 and I'll try reimplementing it without the mock server.

Comment by Hannes Magnusson [ 08/Aug/16 ]

I think all the ssl changes in https://github.com/mongodb/mongo-c-driver/commit/8642ac1a6dd26cc265fbd25c35d7134a21deb0ae should be reverted.
The OpenSSL part of it has been reverted. On Windows, just because recv_connection_closed is set doesn't meant that we don't have anything to read.
We still might have things already buffered up waiting to be decrypted.

Also considering the difficulty in confirming its correctness, and its only used by testing (while producing genuine errors in normal code), I think this ticket should be closed and CDRIVER-1409 reverted

Comment by A. Jesse Jiryu Davis [ 01/Aug/16 ]

I bet I introduced this bug here:

https://github.com/mongodb/mongo-c-driver/commit/8642ac1a6dd26cc265fbd25c35d7134a21deb0ae#diff-c47cc2be4f1259bce0de146b7a3a023eR842

In the same commit I introduced a bug in the OpenSSL integration, which I fixed here:

https://github.com/mongodb/mongo-c-driver/commit/a9739598717eb82a214b7d3fbf922b666f7b345e

Question is, what's the right way for a server-side Secure Channel stream to know the client has closed its side?

Comment by Githook User [ 27/Jul/16 ]

Author:

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

Message: CDRIVER-1423 skip large msg tests w/ OpenSSL on Win
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/d9b55e6ca8406544a3a13f3ee6dbf5409fec81d8

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