Commit graph

118 commits

Author SHA1 Message Date
Roland
810d65068e test exceptions from actor constructor in hierarchy, see #2336
This has brought to light some interesting effects (aka bugs) both in
the general implementation as well as in previous fixes.
SupervisorHierarchySpec is without TODOs now and GREEN.
2012-08-08 07:48:23 +02:00
Roland
2c9ddeb629 test exceptions during recreation, see #2336
fix two bugs:
- resumeChildren should only check the perpetrator if
  inResponseToFailure is true
- handleInvokeFailure must not suspend the survivors in case of an
  exception in postRestart
2012-08-02 16:59:15 +02:00
Viktor Klang
5a51f7750f Hopefully correcting the FSMTransitionSpec and a ScalaDoc issue with mailbox.scala 2012-07-24 16:09:23 +02:00
Roland
dca8d15c68 Merge branch 'wip-2212-recursive-resume-∂π' into wip-scala210M5-√
only merged so that it compiles, will clean up warnings in the following
commits
2012-07-23 14:17:45 +02:00
Viktor Klang
1261fab3af Removing akka.util.NonFatal and replacing it with scala.util.control.NonFatal 2012-07-22 15:33:18 +02:00
Roland
4bbb1dbcbd rename becomeOpen/becomeSuspended to resume/suspend on Mailbox 2012-07-13 12:25:26 +02:00
Roland
1cb204da49 Merge branch 'master' into wip-2212-recursive-resume-∂π
also split out ChildrenContainer into its own file and add
suspendCounter to UnstartedActorCell
2012-07-05 13:18:19 +02:00
Roland
78a39198f1 another round of fixes due to suspend counting, see #2212
- always suspend/resume for Suspend/Resume/Recreate, no matter which
  state the actor is in, to keep the counter balanced
- preRestart failures are logged but otherwise ignored; there’s nothing
  else (apart from terminating the actor) which we could do at that
  point
- preRestart/postRestart exceptions have their own distinguishable
  subtype of ActorKilledException now
- fix some race conditions in tests to make them produce fewer false
  failures
- remove cruft from SupervisorStrategy and add methods which can
  actually be used to implement your own (with proper warning signs)
2012-07-04 09:20:17 +02:00
Viktor Klang
54a3a44bf8 #2292 - Removing akka.util.Duration etc and replace it with scala.concurrent.util.Duration 2012-06-29 13:33:20 +02:00
Roland
3c15dcdfb8 Merge branch 'wip-2031-sync-actorOf-3.0-∂π'
Some tests fail ATM, but I prefer not to hide semantic fixes within
merge commits.
2012-06-25 11:12:08 +02:00
Roland
1400ea605b clarify system.actorOf special semantics section, see #2031 2012-06-25 10:49:49 +02:00
Roland
1148e20dbb add stress test, keep count of suspend/resume, and fix resulting bugs 2012-06-19 11:02:06 +02:00
Roland
b60210362e make system.actorOf() non-blocking (and working), see #2031
- introducing RepointableActorRef, which starts out with an
  UnstartedActorCell which can cheaply be created; the Supervise()
  message will trigger child.activate() in the supervisor, which means
  that the actual creation (now with normal ActorCell) happens exactly
  in the right place and with the right semantics. Messages which were
  enqueued to the dummy cell are transferred atomically into the
  ActorCell (using normal .tell()), so message sends keep working
  exactly as they used to
- this enables getting rid of the brittle synchronization around
  RoutedActorRef by replacing that one with a RepointableActorRef
  subclass which creates RoutedActorCells upon activate(), with the nice
  benefit that there is no hurry then to get it right because the new
  cell is constructed “on the side”

misc fixes:

- InvalidMessageException is now actually enforced when trying to send
  “null”
- Mailboxes may be created without having an ActorCell, which can come
  in handy later, because the cell is only needed when this mailbox is
  going to be scheduled on some executor
- remove occurrences of Props(), which is equivalent to Props[Nothing],
  which is equivalent to «bug»
- add test case which verifies that context.actorOf is still synchronous
- plus all the stuff I have forgotten.
2012-06-13 17:57:56 +02:00
Viktor Klang
18260a3b7b #2203 - publish failed message deliveries to DeadLetters when bounded or durable mailbox enqueues fail 2012-06-08 13:56:53 +02:00
Roland
1b68ea7c9d document processAllSystemMessages semantics 2012-06-07 23:50:23 +02:00
Roland
3271fddd92 do not discard system messages silently after stop 2012-06-07 10:49:20 +02:00
Roland
fd1d0ce121 make cleanUp of systemMessages atomic
- extend systemDrain to take the new contents which shall be switched in
- make NoMessage placeholder which will signal final closing of the
  mailbox
- put that in when cleaning up, and check it when enqueuing
2012-06-04 13:20:53 +02:00
Viktor Klang
2e788c9704 Adding some sanity and some CAS-magic 2012-06-04 11:46:59 +02:00
Viktor Klang
b45cec3da4 Preparing Akka Camel for bin compat 2012-05-23 15:17:49 +02:00
Viktor Klang
22f0062f23 Merge with upstream + minor edits 2012-05-21 11:00:45 +02:00
Viktor Klang
5eba9fceef Saving the planet and shufflin' 2012-05-18 13:37:26 +02:00
Viktor Klang
5ca3fe11f8 Adding tons of ScalaDocs for Mailbox.scala 2012-05-16 17:37:23 +02:00
Viktor Klang
2ee712a8b1 Do not tinker with the 0mq socket for the ConnectionSocketActor on Restart 2012-04-04 11:08:28 +02:00
Roland
ca9d6b369d fix CallingThreadMailbox.numberOfMessages 2012-04-03 16:28:36 +02:00
Roland
64b523638e rework childrenRefs to make context.stop(child) fully asynchronous
- replace TreeMap with custom ChildrenContainer, which has three
  implementations: empty, normal and “terminating” (i.e. waiting for
  some child to terminate)
- split recreate() in the same way as terminate(), so that there is a
  phase during which the suspended actor waits for termination of all
  children which were stopped in preRestart
- do not null out “actor” in ActorCell during restart, because we do
  need the supervisionStrategy and nulling it out does not buy us much
  in this case anyway
- provide new ActorContext.suspendForChildTermination(), which enters
  limbo for as long there are outstanding termination requests; this
  enables code which is very similar to previously (half-working) setups
  with “synchronous” context.stop(child)

docs are still missing, plus a little polishing here and there; oh, and
before I forget: ActorCell NOW is 64 bytes again ;-)
2012-02-29 21:10:31 +01:00
phaller
2d67675057 Update constructors of deque-based mailboxes 2012-02-27 23:26:15 +01:00
phaller
82ac03d882 Merge remote-tracking branch 'origin/master' into wip-stash 2012-02-27 23:00:20 +01:00
Roland
b4fcc3b2f2 Merge remote-tracking branch 'origin/master' into wip-1836-durMB-settings-∂π
... and fix up MailboxType docs with new constructor signature.
2012-02-26 21:38:56 +01:00
Roland
eaee16c7d3 include system.settings when constructing MailboxType, see #1864
- necessary to not have to construct one Settings object per
  MessageQueue
- added system.settings to DispatcherPrerequisites
2012-02-26 21:26:25 +01:00
phaller
601ef17f54 Fix merge issues 2012-02-24 16:32:00 +01:00
Viktor Klang
2c5f65b0b2 #1860 - Making all default messagequeues be the implementation, and therefor avoiding one level of indirection. 2012-02-24 13:13:55 +01:00
Viktor Klang
2b4c8b2508 Changing so that PriorityMailboxes can be used 2012-02-21 17:24:09 +01:00
Roland
c84daf83e8 clean up mailbox types configurability, see #1843
- add (config) constructors to std mailbox types
- update docs for prio mailbox to directly implement MailboxType
2012-02-21 16:40:34 +01:00
Roland
3eeaadd804 move back to explicit enqueue/dequeue delegation from Mailbox to MessageQueue, see #1844 2012-02-21 13:22:25 +01:00
Philipp Haller
bda8617526 Remove DequeBasedMessageQueue.enqueueAllFirst 2012-02-19 23:13:56 +01:00
Roland
2f3737195b split Mailbox and MessageQueue, see #1844
- this enables using any MessageQueue in BalancingDispatcher,
  CallingThreadDispatcher and in general leads to less conflation of
  concepts
- add MessageQueue.cleanUp(owner, deadLetterQueue) for the benefit of
  durable mailboxes
- change MailboxType.create to take an optional owner and generate only
  a MessageQueue, not a Mailbox
2012-02-19 10:28:56 +01:00
Philipp Haller
13488ecd1c Fix merge conflicts 2012-02-13 22:25:55 +01:00
Roland
251a7cc7e3 clean up BalancingDispatcher:
- change from messageQueue.numberOfMessages to maintaining an AtomicLong
  for performance reasons
- add comments/scaladoc where missing
- remove some assert()s
- fix ResiserSpec to employ buddy-wakeup-threshold
2012-02-13 12:38:59 +01:00
phaller
74daec6fe0 Merge branch 'master' into wip-stash 2012-02-13 12:11:37 +01:00
phaller
7511789e90 Clean ups. Reorder traits for readability. Fewer braces. 2012-02-13 12:10:35 +01:00
phaller
7b004c33b9 Make Stash.unstashAll() not atomic. Avoid locking on hot path. Update docs in Stash accordingly. 2012-02-13 10:26:33 +01:00
Roland
a2ef3eed7e scaffolding: make debug printout more useful, add assertions 2012-02-10 20:56:52 +01:00
Roland
ca3deb4007 now that was a nice journey (related to #1804)
- first, fix quite some data races in RoutedActorRef wrt. the contained
  ActorCell’s childrenRef field (which is not even @volatile)
- then notice that there still are double-deregistrations happening in
  the dispatcher
- coming finally to the conclusion that the Mailbox should not really
  process all system messages in processAllSystemMessages(): we should
  really really stop after having closed the mailbox ;-)
- added simple test case which stops self twice to keep this fixed
2012-02-09 17:34:14 +01:00
phaller
fc4d312156 Check capacity in BoundedDequeBasedMessageQueueSemantics.enqueueAllFirst(). Document semantics of unstashAll(). 2012-02-09 14:55:44 +01:00
phaller
4f43141c50 Add bounded deque-based mailbox 2012-02-08 18:26:54 +01:00
Philipp Haller
ab60681a17 Fix merge conflict 2012-02-07 17:04:38 +01:00
Philipp Haller
cdcba16a9c Improve docs. Use private instead of instance-private modifiers. Add return type. 2012-02-07 16:51:20 +01:00
Viktor Klang
66c1e2d835 Sprinkling some finals and adding return types 2012-02-06 15:42:28 +01:00
Philipp Haller
68d6a18883 Add Stash and UnboundedDequeBasedMailbox 2012-02-06 14:49:23 +01:00
Patrik Nordwall
09e13e271b Merge branch 'master' into wip-1310-err2-patriknw
Conflicts:
	akka-actor/src/main/scala/akka/dispatch/AbstractDispatcher.scala
	akka-cluster/src/main/scala/akka/cluster/Cluster.scala
	akka-cluster/src/main/scala/akka/cluster/TransactionLog.scala
	akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala
2012-02-03 13:57:28 +01:00