-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
finagle-mysql: Move Connection Phase to Session Acquisition
Problem / Solution We have added the ability for SSL/TLS to be used with MySQL. To do so for TLS, the MySQL Connection Phase occurs as part of session acquisition in the `MysqlTransporter`. This change moves the Connection Phase for plain text connections there as well. JIRA Issues: CSL-8683 Differential Revision: https://phabricator.twitter.biz/D355549
- Loading branch information
1 parent
ffd3f46
commit cd4877c
Showing
9 changed files
with
142 additions
and
308 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 1 addition & 7 deletions
8
finagle-mysql/src/main/resources/com/twitter/toggles/configs/com.twitter.finagle.mysql.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
{ | ||
"toggles": [ | ||
{ | ||
"id": "com.twitter.finagle.mysql.IncludeHandshakeInServiceAcquisition", | ||
"description": "Perform MySQL session connection phase (handshaking) as part of service acquisition", | ||
"fraction": 0.0 | ||
} | ||
] | ||
"toggles": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 1 addition & 28 deletions
29
finagle-mysql/src/test/scala/com/twitter/finagle/mysql/integration/PingTest.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,14 @@ | ||
package com.twitter.finagle.mysql.integration | ||
|
||
import com.twitter.finagle.toggle.flag | ||
import com.twitter.util.{Await, Duration} | ||
import org.scalatest.FunSuite | ||
|
||
class PingTest extends FunSuite with IntegrationClient { | ||
|
||
test("ping default - (toggle off)") { | ||
test("ping default") { | ||
val theClient = client.orNull | ||
val result = Await.result(theClient.ping(), Duration.fromSeconds(1)) | ||
// If we get here, result is Unit, and all is good | ||
} | ||
|
||
} | ||
|
||
class PingToggleOffTest extends FunSuite with IntegrationClient { | ||
|
||
// For this test, handshaking is done in the dispatcher. | ||
test("ping - (turn toggle off)") { | ||
flag.overrides.let("com.twitter.finagle.mysql.IncludeHandshakeInServiceAcquisition", 0.0) { | ||
val theClient = client.orNull | ||
val result = Await.result(theClient.ping(), Duration.fromSeconds(1)) | ||
// If we get here, result is Unit, and all is good | ||
} | ||
} | ||
|
||
} | ||
|
||
class PingToggleOnTest extends FunSuite with IntegrationClient { | ||
|
||
// For this test, handshaking is done in the transporter. | ||
test("ping - (turn toggle on)") { | ||
flag.overrides.let("com.twitter.finagle.mysql.IncludeHandshakeInServiceAcquisition", 1.0) { | ||
val theClient = client.orNull | ||
val result = Await.result(theClient.ping(), Duration.fromSeconds(1)) | ||
// If we get here, result is Unit, and all is good | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.