Commit graph

157 commits

Author SHA1 Message Date
Roland
f0c370cf87 add NullMessage after Supervise to prevent race, see #2418
- parent just checked for system messages and finds none
- Supervise is enqueued to parent
- Failed is enqueued to the parent
- Failed is processed before Supervise and thus dropped due to
  non-matching UID

remedy is to enqueue NullMessage after enqueuing Supervise but before
really starting the actor, so that if NullMessage overtakes Supervise
the loop in processMailbox will then pick up Supervise next
2012-08-21 13:43:57 +02:00
Roland
853faf815c Merge branch 'wip-2363-actor-identity-fail-∂π' 2012-08-09 18:19:08 +02:00
Viktor Klang
7beff1abe7 Merging with master 2012-08-09 17:08:17 +02:00
Roland
c901980340 fix wrong failure processing after child name reuse, see #2363
- every ActorCell has a UID which is generated from ThreadLocalRandom
  and also sent with Supervise and Failed messages, and the supervisor
  simply does not act upon failures from children whose UID does not
  match
2012-08-09 16:43:12 +02:00
Viktor Klang
9d097bcf50 Making it possible/mandatory to signal which ExecutionContext will actually execute something scheduled 2012-08-08 15:57:30 +02:00
Roland
350407f834 Merge branch 'wip-2336-hierarchy-spec-∂π' 2012-08-08 14:31:46 +02:00
Roland
6145d4313b some cleanup after Viktor’s comments
- remove useless `cause` argument from some akka exceptions
- improve names of some method arguments
- eliminate some closure allocation
2012-08-08 14:13:52 +02:00
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
Viktor Klang
2af08127de Adding support for task batching complete with tests 2012-08-03 23:33:45 +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
0bf45a9403 Initial work in moving to scala.concurrent.Await + Awaitable 2012-06-29 16:06:26 +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
Viktor Klang
1a7f29aaec Making everything compile and tests pass 2012-06-28 15:33:49 +02:00
Viktor Klang
702b5d9c19 Switching to the embedded jsr166y in scala.concurrent and dropping akka.jsr166y 2012-06-26 18:19:55 +02:00
Viktor Klang
7f429ed63e Merge with master 2012-06-25 12:55:25 +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
4ee2033761 Lots and lots of work to get things to compile without warnings 2012-06-13 15:44:24 +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
1821927023 Merge branch 'wip-2134-deathwatch2.0-√' of github.com:akka/akka into wip-2134-deathwatch2.0-√ 2012-06-04 11:48:40 +02:00
Viktor Klang
2e788c9704 Adding some sanity and some CAS-magic 2012-06-04 11:46:59 +02:00
Viktor Klang
17ee47079a Incorporating Roland's feedback 2012-06-02 14:49:28 +02:00
Viktor Klang
96f264e842 Initial stab at DeathWatch 2.0, tests don't pass just yet 2012-05-28 16:49:49 +02:00
Viktor Klang
b45cec3da4 Preparing Akka Camel for bin compat 2012-05-23 15:17:49 +02:00
Viktor Klang
95db4bfd37 Moving out ConfigurationException from akka.config to akka 2012-05-16 17:04:13 +02:00
Viktor Klang
0eb5c503f5 Changing to the correct gh id for me in the Publish.scala 2012-05-11 16:19:46 +02:00
Viktor Klang
db3ce87917 Removing the Atomic*Updaters from MessageDispatcher, switching to Unsafe all the way baby 2012-05-11 15:00:37 +02:00
Roland
afd81d8506 Revert "closes #2019: Use parentheses for arity-0 methods which are not referentially transparent"
This reverts commit 8dbfbbe966.
2012-05-03 21:14:47 +02:00
Heiko Seeberger
8dbfbbe966 closes #2019: Use parentheses for arity-0 methods which are not referentially transparent 2012-04-24 16:38:21 +02:00
Viktor Klang
3badf25bc0 Hardening the suspend/resume methods so that actorcells with dlqs aren't throwing up 2012-04-03 00:37:09 +02:00
Roland
8a5db512f3 fix shutdown of remote routers, see #1872
- ActorCell.stop(actor) removed the actor from childrenRefs before
  handleChildTerminated, leading to removing from Locker immediately
  after adding it in
- intercept ChildTerminated message in RemoteTransport.receive if
  destination is not found (i.e. isTerminate==true) and re-route to
  Locker, which was changed to support path-based lookup to find the
  parent and funnel the ChildTerminated to its intended destination
- add Locker.shutdown() to detach remaining actors from their
  dispatchers upon system termination.
2012-02-28 15:48:02 +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
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
Viktor Klang
3a1cdab917 Adding union interfaces for ES and EC and E and adding tests to verify signatures 2012-02-16 17:24:08 +01:00
Viktor Klang
607ec4c2cf Switching approaches to check for max throttle 2012-02-13 18:14:35 +01:00
Roland
7c57a9d60e final touch to actor start-up sequence
split systemDispatch(Create()) into systemEnqueue(Create()) directly
after createMailbox and registerForExecution from within
Dispatcher.attach() (resp. CallingThreadDispatcher.register() does its
own thing)
2012-02-13 15:33:31 +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
Roland
a2ef3eed7e scaffolding: make debug printout more useful, add assertions 2012-02-10 20:56:52 +01:00
Roland
d2f28a06cd Merge remote-tracking branch 'origin/master' into wip-1750-remove-ReflectiveAccess-∂π 2012-02-10 11:41:47 +01:00
Roland
dca309c535 incorporate Patrik’s feedback
- rename to DynamicAccess
- rename to createInstanceFor / createClassFor
- fix a few little things
2012-02-10 11:36:23 +01:00
Jonas Bonér
51a218b87f Fixes ticket #1809 - Harmonize configuration option names.
Signed-off-by: Jonas Bonér <jonas@jonasboner.com>
2012-02-09 20:40:09 +01:00
Roland
2ce47d6bb5 Bye-bye ReflectiveAccess, introducing PropertyMaster, see #1750
- PropertyMaster is the only place in Akka which calls
  ClassLoader.getClass (apart from kernel, which might be special)
- all PropertyMaster methods (there are only three) take a ClassManifest
  of what is to be constructed, and they verify that the obtained object
  is actually compatible with the required type

Other stuff:
- noticed that I had forgotten to change to ExtendedActorSystem when
  constructing Extensions by ExtensionKey (damn you, reflection!)
- moved Serializer.currentSystem into JavaSerializer, because that’s the
  only one needing it (it’s only used in readResolve() methods)
- Serializers are constructed now with one-arg constructor taking
  ExtendedActorSystem (if that exists, otherwise no-arg as before), to
  allow JavaSerializer to do its magic; possibly necessary for others as
  well
- Removed all Option[ClassLoader] signatures
- made it so that the ActorSystem will try context class loader, then
  the class loader which loaded the class actually calling into
  ActorSystem.apply, then the loader which loaded ActorSystemImpl
- for the second of the above I added a (reflectively accessed hopefully
  safe) facility for getting caller Class[_] objects by using
  sun.reflect.Reflection; this is optional an defaults to None, e.g. on
  Android, which means that getting the caller’s classloader is done on
  a best effort basis (there’s nothing we can do because a StackTrace
  does not contain actual Class[_] objects).
- refactored DurableMailbox to contain the owner val and use that
  instead of declaring that in all subclasses
2012-02-09 11:56:43 +01:00
Patrik Nordwall
df1606a8ee Adjustments based on review. See #1805 2012-02-08 14:03:31 +01:00
Patrik Nordwall
1f988889c2 Proper thread names for fork-join-executor. See #1805 2012-02-08 11:53:55 +01:00
Patrik Nordwall
9c8c0d42c5 Add @SerialVersionUID to Serializable classes. See #1786
* @SerialVersionUID(1L)
* UntypedActorFactory serialization, and test
* Removed Serializable from Serializers
2012-02-07 10:05:54 +01:00
Viktor Klang
66c1e2d835 Sprinkling some finals and adding return types 2012-02-06 15:42:28 +01:00
Viktor Klang
09c44289d4 Creating our own FJTask and escalate exceptions to UHE 2012-02-06 15:19:05 +01:00