[SERVER-7940] SSL unexpectedly returns SSL_ERROR_WANT_xxxx Created: 14/Dec/12  Updated: 11/Jul/16  Resolved: 13/Feb/13

Status: Closed
Project: Core Server
Component/s: Networking
Affects Version/s: 2.3.1
Fix Version/s: 2.4.0-rc1

Type: Bug Priority: Major - P3
Reporter: Eric Milkie Assignee: Eric Milkie
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

Sometimes the jstests/ssl/replset1.js test hits _handleSSLError with a code of SSL_ERROR_WANT_xxxx. This error is unexpected, and apparently the handling of it is causing a resource leak (the connection is not closed but another one is started)
http://buildbot-special.10gen.com/builders/Nightly%20Linux%2064-bit%20SSL%20Amazon%20AMI/builds/318/steps/test/logs/stdio



 Comments   
Comment by auto [ 13/Feb/13 ]

Author:

{u'date': u'2013-02-13T02:38:04Z', u'name': u'Eric Milkie', u'email': u'milkie@10gen.com'}

Message: SERVER-7940 do not call non-reentrant functions more than once

Some SSL initialization functions are documented as being non-reentrant,
so let's make sure we only call them once per process.
Note that this won't guarantee anything for the C++ driver usage of SSL.
Branch: master
https://github.com/mongodb/mongo/commit/4fd7f7facda415834854c203a38d66df234f648a

Comment by Eric Milkie [ 23/Jan/13 ]

Not fixed. Just failed again by retrying three times on connect and yet receiving SSL_ERROR_WANT_READ each time.

Comment by auto [ 18/Jan/13 ]

Author:

{u'date': u'2013-01-18T22:38:49Z', u'email': u'milkie@10gen.com', u'name': u'Eric Milkie'}

Message: SERVER-7940 handle SSL_ERROR_WANT_READ from SSL_Connect()
Branch: master
https://github.com/mongodb/mongo/commit/3d697bb6f776c9c435dc6138b373e4d7672f06ff

Comment by Eric Milkie [ 18/Jan/13 ]

The new code has now reproduced the problem with stack trace. The error is SSL_ERROR_WANT_READ and it is coming from SSL_Connect(). This makes no sense, as we are using blocking sockets and we turned on AUTO_RETRY.
I can't find anything online describing this situation.
I am going to attempt to call connect again when this error happens.

Comment by auto [ 14/Jan/13 ]

Author:

{u'date': u'2013-01-14T16:12:21Z', u'email': u'milkie@10gen.com', u'name': u'Eric Milkie'}

Message: SERVER-7940 abort when receiving SSL_ERROR_WANT_xxx

This should give us a stack trace to help diagnose and better fix this bug.
Branch: master
https://github.com/mongodb/mongo/commit/da0ddc4023a9dbfa1a615ea7b5ac28ef903c850b

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