diff --git a/akka-actors/src/main/scala/actor/Actor.scala b/akka-actors/src/main/scala/actor/Actor.scala index c2b1b67e59..ca81a55131 100644 --- a/akka-actors/src/main/scala/actor/Actor.scala +++ b/akka-actors/src/main/scala/actor/Actor.scala @@ -253,8 +253,15 @@ trait Actor extends Logging with TransactionManagement { */ def !![T](message: AnyRef, timeout: Long): Option[T] = if (isRunning) { val future = postMessageToMailboxAndCreateFutureResultWithTimeout(message, timeout) - if (message.isInstanceOf[Invocation] && message.asInstanceOf[Invocation].isVoid) future.completeWithResult(None) - future.await + val isActiveObject = message.isInstanceOf[Invocation] + if (isActiveObject && message.asInstanceOf[Invocation].isVoid) future.completeWithResult(None) + try { + future.await + } catch { + case e: FutureTimeoutException => + if (isActiveObject) throw e + else None + } getResultOrThrowException(future) } else throw new IllegalStateException("Actor has not been started, you need to invoke 'actor.start' before using it") @@ -274,7 +281,7 @@ trait Actor extends Logging with TransactionManagement { * Sends a message asynchronously, but waits on a future indefinitely. E.g. emulates a synchronous call. *

* NOTE: - * Should be used with care. + * Should be used with care (almost never), since very dangerous (will block a thread indefinitely if no reply). */ def !?[T](message: AnyRef): T = if (isRunning) { val future = postMessageToMailboxAndCreateFutureResultWithTimeout(message, 0) diff --git a/akka.ipr b/akka.ipr index a221621c9a..cef92743bd 100644 --- a/akka.ipr +++ b/akka.ipr @@ -614,17 +614,6 @@ - - - - - - - - - - - @@ -779,17 +768,6 @@ - - - - - - - - - - - @@ -1274,17 +1252,6 @@ - - - - - - - - - - - @@ -1384,6 +1351,17 @@ + + + + + + + + + + + diff --git a/akka.iws b/akka.iws index 5d836bb64a..adb7a8b56a 100644 --- a/akka.iws +++ b/akka.iws @@ -5,9 +5,9 @@ + + - - @@ -105,7 +105,7 @@