[CDRIVER-630] default_stream_initiator can block forever in TLS handshake Created: 01/May/15 Updated: 08/Jan/24 Resolved: 10/Aug/15 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | None |
| Affects Version/s: | 1.1.4 |
| Fix Version/s: | 1.2-beta0, 1.1.5 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Mira Carey | Assignee: | Hannes Magnusson |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
*UPDATE*: Fixed in 1.1.5, still reproducible in 1.2.0. Uncomment the "/TLS/handshake_stall" test and fix in 1.2.0-dev branch. The default stream initiator in mongoc_client.c makes a blocking call to mongoc_stream_tls_do_handshake(). This can cause the driver to full hang until some kind of network error is returned. https://github.com/mongodb/mongo-c-driver/blob/master/src/mongoc/mongoc-client.c#L339 We should pull connecttimeoutms or sockettimeoutms out of the uri and use that in lieu of permanent blocking. |
| Comments |
| Comment by Githook User [ 10/Aug/15 ] | |||||||||||||||||
|
Author: {u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}Message: | |||||||||||||||||
| Comment by Githook User [ 27/May/15 ] | |||||||||||||||||
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: | |||||||||||||||||
| Comment by Githook User [ 08/May/15 ] | |||||||||||||||||
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@emptysquare.net'}Message: Merge pull request #229 from ajdavis/ fix hang in TLS handshake | |||||||||||||||||
| Comment by Githook User [ 08/May/15 ] | |||||||||||||||||
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: | |||||||||||||||||
| Comment by Githook User [ 08/May/15 ] | |||||||||||||||||
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: | |||||||||||||||||
| Comment by Githook User [ 08/May/15 ] | |||||||||||||||||
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: | |||||||||||||||||
| Comment by A. Jesse Jiryu Davis [ 03/May/15 ] | |||||||||||||||||
|
To reproduce, make a trivial server in Python:
Connect to it with the "example-client" program from the mongo-c-driver repository:
This hangs forever, because the client successfully connects but the server doesn't respond when the client initiates a TLS handshake. Without TLS, on the other hand:
The example client connects and begins a query, which times out after a second, as designed. |