Commit graph

72 commits

Author SHA1 Message Date
Patrik Nordwall
f772b0183e Initial commit of dispatcher key refactoring, for review. See #1458
* Changed signatures and constructor of MessageDispatcherConfigurator
* Changed Dispatchers.lookup, keep configurators instead of dispatchers
* Removed most of the Dispatchers.newX methods, newDispatcher is still there because of priority mailbox
* How should we make it easy to configure priority mailbox?
* Changed tons tests
* Documentation and ScalaDoc is not updated yet
* Some tests in ActorModelSpec are temporary ignored due to failure
2011-12-21 13:27:50 +01:00
Viktor Klang
47c1be6b42 Adding FIXME comments to unprotected casts to ActorSystemImpl (4 places) 2011-12-19 14:04:32 +01:00
Viktor Klang
e959493e12 Enormous merge with master which probably led to the indirect unfortunate deaths of several kittens 2011-12-14 17:36:39 +01:00
Roland
92e7693203 Merge remote-tracking branch 'origin/master' into wip-remote-supervision-rk 2011-12-13 16:59:43 +01:00
Roland
040f3076bc add watch/unwatch for testActor to TestKit 2011-12-13 15:41:00 +01:00
Jonas Bonér
c9b787f029 Removed all 'actorOf' methods that does not take a 'Props', and changed all callers to use 'actorOf(Props(..))'
Signed-off-by: Jonas Bonér <jonas@jonasboner.com>
2011-12-13 14:09:40 +01:00
Viktor Klang
b32cbbc764 Renaming Block to Await, renaming sync to result, renaming on to ready, Await.ready and Await.result looks and reads well 2011-12-12 22:50:08 +01:00
Patrik Nordwall
bfa14a692c Merge branch 'master' into wip-1377-context-patriknw
Conflicts:
	akka-actor/src/main/scala/akka/actor/ActorCell.scala
	akka-actor/src/main/scala/akka/actor/ActorRef.scala
	akka-actor/src/main/scala/akka/dispatch/AbstractDispatcher.scala
	akka-actor/src/main/scala/akka/event/EventStream.scala
	akka-tutorials/akka-tutorial-first/src/main/java/akka/tutorial/first/java/Pi.java
	akka-tutorials/akka-tutorial-first/src/main/scala/Pi.scala
2011-12-07 07:49:34 +01:00
Patrik Nordwall
3204269f6a Cleanup of methods in Actor and ActorContext trait. See #1377
* Added JavaActorContext, UntypedActor.getContext
* implicit val context in Actor needs to be implicit to support forward,
it would be nice if it wasn't implicit because now I can't override context
in UntypedActor
* Removed implicit def system in Actor
* Removed implicit def defaultTimeout in Actor
* Removed receiveTimeout, children, dispatcher, become, unbecome, watch,
unwatch in Actor
* Removed corresponding as above from UntypedActor
* Removed implicit from dispatcher in ActorSystem
* Removed implicit def timeout in TypedActor
* Changed receiveTimeout to use Duration (in api)
* Changed many tests and samples to match new api
2011-12-06 09:50:16 +01:00
Roland
c0c9487451 make testActor spew out uncollected messages after test end
(so you don’t need expectNoMsg after tests)
2011-12-05 19:03:01 +01:00
Patrik Nordwall
b488d70f54 Fixed several memory and thread leaks. See #1404
* Dispatchers need Scheduler to be able to shutdown themselves. Stop Scheduler after dispatchers.
* Changed CallingThreadDispatcher global object to Extension, since it holds map of references to mailboxes. Will be GC:ed when system is GC:ed.
* Made testActor lazy, since it is not used in all tests, and it creates CallingThreadDispatcher.
* Activated some java tests that were not running
* Many tests were not stopping created ActorSystems. VERY IMPORTANT TO STOP ActorSystem in tests. Use AkkaSpec as much as possible.
* Used profiler to verify (and find) dangling ActorSystemImpl and threads from dispatchers.
* FutureSpec creates ForkJoinPool threads that are not cleared, but number of threads don't grow so it's not a problem.
2011-12-02 09:48:21 +01:00
Viktor Klang
bf20f3fa44 Reinterpretation of Extensions 2011-11-24 18:53:18 +01:00
Patrik Nordwall
179399296e Modularize configuration. See #1361
* Split config reference to one for each module/extension.
* Adjusted signature of registerExtension to avoid race of extension init
* Moved Duration.dilated to testkit
* TestKitExtension
* RemoteExtension
* SerializationExtension
* Durable mailboxes extensions
* Fixed broken serialization bindings and added test
* Updated configuration documentation
* System properties akka.remote.hostname akka.remote.port replaced with akka.remote.server.hostname and akka.remote.server.port
* Adjustments of ActorSystem initialization. Still don't like the two-phase constructor/init flow. Very fragile for changes.

Review fixes. SerializationExtension
2011-11-23 20:31:58 +01:00
Roland
6a8e516b6c change source tag in log events from AnyRef to String
- ensure that no “complex” things are attached to a LogEvent (think
  serialization)
- ensure no escaping the “this” reference via LoggingBus during
  constructors (e.g. ActorSystem)
- change it so that
    + Actor/ActorRef are represented by their address
    + Class[_] by simpleName
    + String by itself
- this means that people need to think a little more while deciding how
  “this” should look like in logging (which I think is a good thing)
2011-11-18 12:24:04 +01:00
Viktor Klang
80d766b07b Adding DispatcherPrerequisites to hold the common dependencies that a dispatcher needs to be created 2011-11-17 16:09:18 +01:00
Roland
d381b72061 rename app: ActorSystem to system everywhere 2011-11-17 12:36:35 +01:00
Roland
c31695bef4 rename AkkaConfig to Settings 2011-11-17 12:11:55 +01:00
Roland
648661c548 clean up initialization of ActorSystem, fixes #1050
- create ActorSystemImpl trait to make ActorSystem fully abstract
- add Java API for constructing (ActorSystem.create(...))
- only go through factory methods because .start() has become necessary
- rename all user-facing occurrences of “app” to “system” (Actor trait
  and TestKit/AkkaSpec)
- pass ActorSystemImpl to ActorRefs upon creation, which means that
  actorOf() and friends need such an argument, which must be provided to
  the ActorRefProvider by the ActorRefFactory implementation
2011-11-16 17:18:36 +01:00
Roland
f2bf27b4de remove app argument from Dispatchers
(cascading into all dispatchers, mailboxes, other stuff; had to move
deadLetter stuff to ActorSystem again and split its initialization due
to cyclic dependency)
2011-11-14 16:03:26 +01:00
Roland
6097db55c6 do not stop testActor
- automatic timeout was previously used for allowing clean shutdown, but
  that does not work anymore anyway, must call ActorSystem.stop()
- that will also stop testActor, so no need for special treatment
- the automatic stop caused various eerie problems in different places,
  because on Jenkins some sleep periods were longer, leading to such
  timeout, which combined with the non-logging of dead letters made it
  seem worse than it was
2011-11-13 00:34:30 +01:00
Roland
02a5cd081c remove ActorRef from Failed/ChildTerminated and make some warnings nicer
- the same information is transmitted as sender, hence enabling
  ChildTerminated to become a singleton
- make lastSender accessible in TestKit (needed now for DeathWatchSpec)
- fix nasty infinite loop when logging at the wrong moment during
  shutdown
2011-11-13 00:19:56 +01:00
Roland
56cb2a2f30 clean up test output, increase default timeouts
- apply EventFilters so that at least on my machine no expected messages
  are printed
- add new test config settings to akka-reference.conf
- set default for loglevel to WARNING
- print out timeout values in case of various timeouts if they occur
2011-11-11 20:56:48 +01:00
Roland
9a10953219 Add config default for TestKit wait periods outside within()
- introduce Duration.Undefined and use that to initialize TestKit.end
  (also use in places which abused Duration.MinusInf for similar
  purposes)
- TestKit.remaining now returns AkkaConfig.SingleExpectDefaultTimeout if
  end == Duration.Undefined

This will hopefully catch most of the cases where Jenkins previously
aborted the build after 60min.
2011-11-11 16:53:13 +01:00
Roland
945b1aedf9 rename akka.AkkaApplication to akka.actor.ActorSystem
Renaming it to System did not appeal after seeing that such a thing is
already imported from Predef ...
2011-11-10 21:00:01 +01:00
Roland
a747ef7856 Merge remote branch 'origin/master' into logging
BalancingDispatcherModelSpec is currently broken, leaves count==1 in
wavesOfActors test, committed anyway in order to check out where it
broke before this merge
2011-11-09 14:56:05 +01:00
Roland
b3249e0adb finish EventFilter work and apply in three places
- fix memory visibility issue with occurrences counter
- add non-throwing awaitCond and use that for better error reporting
- move occurrence book-keeping (side-effect) out of PF guard, was
  evaluated multiple times (of course!)
- apply in cases where EventFilter.custom was used (one legitimate use
  case remains)
2011-11-09 11:04:39 +01:00
Roland
c1a9475015 TestEventFilter overhaul
- make normal filters available for all four log levels
- allow filtering for
  + exact and complete message
  + start of message
  + regular expression
- keep count of occurrences if requested and verify correct count at end
  of filterEvents/filterExceptions block
- remove akka.testkit.Testing (sleepFor replaced by Duration.dilated.sleep)
- remove Duration.timeFactor (needs config -> AkkaApplication)
- TestLatch needs config -> AkkaApplication (was forgotten because used
  directly System.getProperty)
- lots of scaladoc for TestEventListener infrastructure
2011-11-07 22:23:48 +01:00
Roland
6559511bce FSMTimingSpec overhaul
- revise timings to make them more robust (granularity changed in
  general from 100ms to 500ms)
- make one test more deterministic by awaiting context.hasMessages,
  which has been added for this purpose; is the same kind of “non-racy”
  as isShutdown
- add static version of TestKit.awaitCond (checked that it does not
  conflict, even when “import TestKit._” is used; seems like imports are
  not even searched if the symbol is found locally)
2011-11-06 12:10:14 +01:00
Roland
91bee0370c fix TestKit.receiveWhile when using implicitly discovered maximum wait
time (i.e. default argument)
2011-11-03 19:11:15 +01:00
Viktor Klang
1b730b5c82 Removing Channel(s), tryTell etc, everything compiles but all tests are semibroken 2011-10-31 16:09:51 +01:00
Roland
f46c6dc533 introducing: MainBus feat. LoggingBus
most tests passing, everything compiling, but docs not updated and nasty
thread-leak preventing me from running the whole test-suite (which is
the reason for this commit: I want to chase down that one first).

- the app.mainbus is classified by Class[_] (currently lookup, will
  possibly change to sub-class-aware) and accepts AnyRef messages
- LoggingBus handles akka.event-handlers from config specially:
  + start them as system services, supervised by SystemGuardian
  + keep their subscriptions in sync when logLevel_= is called
  + send them InitializeLogger(bus) message before subscribing them (so
    they can register for extras like Mute/UnMute)
- two-phased start-up: first phase with actor-less stdout logging, then
  subscription of config loggers, then remove stdout logger (logLevels
  configurable separately)
- MainBusReaper watches registered receivers and unsubscribes them upon
  death (started in phase 2)
- logger factory on Logging object, needs app/bus and log source;
  default instance in app.log
2011-10-27 12:36:22 +02:00
Roland
d55f02e6c1 merge master into parental-supervision, fixing up resulting breakage 2011-10-21 15:11:43 +02:00
Roland
25f436d521 add TestKit.fishForMessage 2011-10-20 13:43:24 +02:00
Roland
d3837b9fc3 Introduce parental supervision, BUT TESTS ARE STILL FAILING
- every actor is now supervised, where the root of the tree is
  app.guardian, which has its supervisor field set to a special ActorRef
  obtained from provider.theOneWhoWalksTheBubblesOfSpaceTime (this name
  is meant to indicate that this ref is outside of the universe, cf.
  Michio Kaku)
- changed all tests to obtain specially supervised children (i.e. not
  top-level) via (supervisor ? Props).as[ActorRef].get
- add private[akka] ScalaActorRef.sendSystemMessage for sending
  Supervise()
- everything routing or remote is broken wrt. supervision, as that was
  not “properly” implemented to begin with, will be tackled after
  app/supervision/eventbus/AkkaSpec are stabilized enough
2011-10-19 17:18:50 +02:00
Viktor Klang
77dc9e9c35 #1299 - Removing reply and tryReply, preparing the way for 'sender ! response' 2011-10-19 16:59:47 +02:00
Viktor Klang
7a6508973f Adding extra output to give more hope in reproducing weird test failure that only happens in Jenkins 2011-10-18 12:40:44 +02:00
Roland
9e8091459b rename application to app everywhere to make it consistent 2011-10-13 14:23:44 +02:00
Roland
85b7accfd4 make EventHandler non-global
- add Logging trait for nicer interface
- add EventHandlerLogging class for offering the nice interface from
  app.log
- add eventHandler instance to app and use that for all internal logging
  (this means that some places (dispatchers, remoting) were infiltrated
  by app just to do logging, but I think we'll need app in there soon
  enough for other reasons)
2011-10-13 13:21:59 +02:00
Peter Vlugter
e25ee9f0e2 Fix remote main compile and testkit tests 2011-10-12 15:36:10 +02:00
Roland
93b1ef3703 make akka-actor-tests compile again 2011-10-11 16:05:48 +02:00
Roland
2599de0381 Scalariform & add AkkaSpec 2011-10-10 11:22:01 +02:00
Peter Vlugter
3aadcd7645 Update stm module to work with AkkaApplication 2011-10-07 15:22:36 +02:00
Roland
2381ec54d0 introduce AkkaApplication
- remove global Config
- pull everything which depended on it into new AkkaApplication
- leave EventHandler alone for the moment: that evil sucker gets his
  very own AkkaApplication("akka-reference.conf") until we have settled
  on an acceptable logging API without globals
- make akka-actor and akka-testkit compile
- TestKit uses implicit AkkaApplication passing for maximum convenience
- Actor object nearly completely removed, actor creation possible via
  ActorRefFactory interface which is implemented by AkkaApplication and
  ActorContext
- serialization of ActorRef is probably broken, and so is the reflective
  RemoteSupport (now needs AkkaApplication constructor arg)
- everything else is still broken, including akka-actor-tests, so this
  is of course all not runtime-tested
2011-10-06 21:19:46 +02:00
Viktor Klang
a12ee36151 Merge commit 2011-09-29 13:11:35 +02:00
Roland
fd78af410c add () after side-effecting TestKit methods, fixes #1234 2011-09-28 12:59:51 +02:00
Viktor Klang
24d9a4d143 Merging with master 2011-09-27 18:02:57 +02:00
Peter Vlugter
7b1cdb4457 Remove SelfActorRef and use ActorContext to access state in ActorInstance. See #1202
- removed SelfActorRef
- added an ActorContext interface that provides a view into ActorInstance
- the ActorInstance (as ActorContext) gets injected into the Actor
- moved self methods like sender and reply directly to the Actor
2011-09-19 12:03:15 +02:00
Roland
c1d9b49935 improve failure messages in case of expectMsg... timeout
- always include the (set of) expected message(s)
- only thing missing is in case of expectMsgPF: cannot print PF code
2011-09-16 10:59:12 +02:00
Viktor Klang
bbb79d8e0d Start removed but cluster is broken 2011-09-08 11:02:17 +02:00
Viktor Klang
c7d58c600b Adding initial support for Props 2011-08-26 17:25:18 +02:00