Skip to content

Instantly share code, notes, and snippets.

@przemek-pokrywka
Created May 19, 2011 20:01
Show Gist options
  • Save przemek-pokrywka/981598 to your computer and use it in GitHub Desktop.
Save przemek-pokrywka/981598 to your computer and use it in GitHub Desktop.
A quick-hack-dirty-fix for Smile hanging threads' problem described at https://github.com/robey/kestrel/issues/26
index 2cb9192..42bea4b 100644
--- a/src/main/scala/net/lag/smile/MemcacheConnection.scala
+++ b/src/main/scala/net/lag/smile/MemcacheConnection.scala
@@ -119,7 +119,7 @@ class MemcacheConnection(val hostname: String, val port: Int, val weight: Int) {
@throws(classOf[MemcacheServerException])
def store(query: String, key: String, value: Array[Byte], flags: Int, expiry: Int): Boolean = {
- serverActor !? Store(query, key, flags, expiry, value) match {
+ serverActor.!?(20 * 1000l, Store(query, key, flags, expiry, value)).getOrElse(Error("Unable to send message to server due to a temporary local problem")) match {
case Timeout =>
registerFailure()
throw new MemcacheServerTimeout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment