GitHub user jamesreggio opened a pull request: https://github.com/apache/thrift/pull/985
THRIFT-3786 Fix premature firing of `connect` event for secure sockets `tls.connect()` returns a socket that will fire a `connect` event when the initial socket is connected, followed by a `secureConnect` event when the TLS handshake is complete This commit causes the Thrift connection to wait until `secureConnect` to broadcast its own `connect` event and begin using the secure socket. This helps to resolve a race condition where commands issued after `connect` but before `secureConnect` are lost. It also fixes loss of commands in the offline queue, as well as double-broadcasting due to the same handler running on both underlying `connect` events. You can merge this pull request into a Git repository by running: $ git pull https://github.com/jamesreggio/thrift THRIFT-3786 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/thrift/pull/985.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #985 ---- commit b76bad70826d539ddfb26b5277ff3bc09ffa9803 Author: James Reggio <james.reg...@gmail.com> Date: 2016-04-11T17:53:12Z THRIFT-3786 Fix premature firing of `connect` event for secure sockets tls.connect() returns a socket that will fire a `connect` event when the initial socket is connected, followed by a `secureConnect` event when the TLS handshake is complete This commit causes the Thrift connection to wait until `secureConnect` to broadcast its own `connect` event and begin using the secure socket. This helps to resolve a race condition where commands issued after `connect` but before `secureConnect` are lost. It also fixes loss of commands in the offline queue, as well as double-broadcasting due to the same handler running on both underlying `connect` events. ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---