Skip to content

Commit 19d7269

Browse files
committed
Removing timeout implementation for MySQL, client code should be responsible for deciding a timeout on it's futures
1 parent c06eb58 commit 19d7269

File tree

3 files changed

+7
-17
lines changed

3 files changed

+7
-17
lines changed

db-async-common/src/main/scala/com/github/mauricio/async/db/Configuration.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,4 @@ case class Configuration(username: String,
5454
maximumMessageSize: Int = 16777216,
5555
allocator: AbstractByteBufAllocator = PooledByteBufAllocator.DEFAULT,
5656
connectTimeout: Duration = 5.seconds,
57-
testTimeout: Duration = 5.seconds,
58-
requestTimeout: Duration = 5.seconds)
57+
testTimeout: Duration = 5.seconds)

mysql-async/src/main/scala/com/github/mauricio/async/db/mysql/MySQLConnection.scala

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package com.github.mauricio.async.db.mysql
1818

19-
import java.util.concurrent.TimeoutException
2019
import java.util.concurrent.atomic.{AtomicLong, AtomicReference}
2120

2221
import com.github.mauricio.async.db._
@@ -189,17 +188,10 @@ class MySQLConnection(
189188
val promise = Promise[QueryResult]()
190189
this.setQueryPromise(promise)
191190
this.connectionHandler.write(new QueryMessage(query))
192-
addTimeout(promise)
193191

194192
promise.future
195193
}
196194

197-
private def addTimeout(promise: Promise[QueryResult]): Unit = {
198-
this.connectionHandler.schedule(
199-
promise.tryFailure(new TimeoutException(s"response took too long to return(${configuration.requestTimeout})")),
200-
configuration.requestTimeout)
201-
}
202-
203195
private def failQueryPromise(t: Throwable) {
204196
this.clearQueryPromise.foreach {
205197
_.tryFailure(t)
@@ -244,7 +236,6 @@ class MySQLConnection(
244236
val promise = Promise[QueryResult]()
245237
this.setQueryPromise(promise)
246238
this.connectionHandler.sendPreparedStatement(query, values)
247-
addTimeout(promise)
248239

249240
promise.future
250241
}

project/Build.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,18 @@ object ProjectBuild extends Build {
4545

4646
object Configuration {
4747

48-
val commonVersion = "0.2.17"
49-
val projectScalaVersion = "2.11.0"
48+
val commonVersion = "0.2.18-SNAPSHOT"
49+
val projectScalaVersion = "2.11.7"
5050

5151
val specs2Dependency = "org.specs2" %% "specs2" % "2.3.11" % "test"
52-
val logbackDependency = "ch.qos.logback" % "logback-classic" % "1.0.13" % "test"
52+
val logbackDependency = "ch.qos.logback" % "logback-classic" % "1.1.3" % "test"
5353

5454
val commonDependencies = Seq(
55-
"org.slf4j" % "slf4j-api" % "1.7.5",
55+
"org.slf4j" % "slf4j-api" % "1.7.12",
5656
"joda-time" % "joda-time" % "2.3",
5757
"org.joda" % "joda-convert" % "1.5",
58-
"io.netty" % "netty-all" % "4.0.25.Final",
59-
"org.javassist" % "javassist" % "3.18.1-GA",
58+
"io.netty" % "netty-all" % "4.0.29.Final",
59+
"org.javassist" % "javassist" % "3.20.0-GA",
6060
specs2Dependency,
6161
logbackDependency
6262
)

0 commit comments

Comments
 (0)