Commit graph

71 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
Patrik Nordwall
60f45c72f6 Move dispatcher-shutdown-timeout to dispatcher config. See #1512. 2011-12-20 13:40:51 +01:00
Patrik Nordwall
61813c6635 Make MailboxType implementation configurable. See #1484
* Added mailboxType property to dispatcher config
* Changed durable mailboxes to use this
* Updated docs for durable mailboxes
2011-12-19 21:41:02 +01:00
Viktor Klang
89e29b07e1 Adding daemonicity to the dispatcher configurator 2011-12-13 20:24:09 +01:00
Roland
92e7693203 Merge remote-tracking branch 'origin/master' into wip-remote-supervision-rk 2011-12-13 16:59:43 +01:00
Jonas Bonér
4d649c3903 Removed all @author tags for Jonas Bonér since it has lost its meaning.
Signed-off-by: Jonas Bonér <jonas@jonasboner.com>
2011-12-09 18:44:59 +01:00
patriknw
02889404fe Merge pull request #143 from jboner/wip-1435-doc-java-actors-patriknw
Updated documentation of Actors (Java). See #1435
2011-12-09 04:32:24 -08:00
Patrik Nordwall
f28a1f3834 Fixed another shutdown of dispatcher issue. See #1454 2011-12-09 12:16:13 +01:00
Patrik Nordwall
ce128740ab Updated documentation of Actors (Java). See #1435
* Aligned the Java and Scala documentation for Actors
* Implemented hotswap samples in Java, and documented in same way as Scala docs
* Improved Actors (Scala) docs
* Fixed wrong preRestart and postRestart in UntypedActor
* Changed name of Dispatchers.fromConfig to newFromConfig and made it Java friendly
* Added ActorRef.ask with Timeout parameter in addition to the timeoutMillis
2011-12-08 19:30:04 +01:00
Roland
fac840adfc make remote lookup work
- create RemoteActorRef in actorFor
- simplify send/receive because Futures/Exceptions do not go over the
  wire anymore
- add RemoteCommunicationSpec which uses two ActorSystems communicating
  in the same JVM via TCP socket
2011-12-08 14:44:05 +01:00
patriknw
738857ccc2 Merge pull request #137 from jboner/wip-1435-doc-scala-actors-patriknw
Updated documentation of Actors Scala. See #1435
2011-12-07 08:11:06 -08:00
Viktor Klang
72d69cb7cc Moving all the logic for cleaning up mailboxes into the mailbox implementation itself 2011-12-07 15:51:46 +01:00
Patrik Nordwall
5cee76820e Updated documentation of Actors Scala. See #1435 2011-12-07 11:56:58 +01:00
Viktor Klang
aa9b077657 Adding support for range-based setting of pool sizes 2011-12-07 11:25:27 +01:00
Patrik Nordwall
1a93ddb7c0 Merge branch 'master' into wip-1377-context-patriknw 2011-12-07 08:07:58 +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
Roland
831b3272ad add min/max bounds on absolute number of threads for dispatcher
The reason for the previously failing test case was that Jenkins has
only two (logical) cores and the test config sets the
core-pool-size-factor to 2, meaning four threads. This is not enough to
have four Futures waiting (as per the test) and one actor which actually
does the work (the guardian in this case). Hence, make it so that
core-pool-size-min gives the absolute minimum and set the default of
that to eight.

While doing so I cleaned up the MessageDispatcherConfigurator to not use
HOF since now configuration items are not optional anymore, yielding a
flow which is much more readily understandable.
2011-12-06 20:39:26 +01:00
Patrik Nordwall
7595e52bc9 Renamed startsWatching to watch, and stopsWatching to unwatch 2011-12-06 09:59:52 +01:00
Roland
9d7597c728 Merge branch master into wip-ActorPath-rk
Had to make Davy Jones a bit more robust, i.e. put him into a different
system to guarantee survival until all messages are delivered.
2011-12-05 22:46:34 +01:00
Roland
1755aedb58 make scheduler shutdown more stringent
- run closeScheduler upon ActorSystem termination (directly)
- this will execute all outstanding tasks (dispatcher shutdowns have
  been queued already, because the last actor has already exited)
- further use of the scheduler (e.g. from tasks just being run) results
  in IllegalStateException
- catch such exceptions in DefaultPromise&MessageDispatcher in case of
  self-rescheduling tasks and execute final action immediately
- also silently stop recurring tasks
2011-12-03 21:26:32 +01:00
Roland
4c1d722398 fix bug in ActorRef.stop() implementation
- it was telling all children to stop(), then waited for the
  ChildTerminated messages and finally terminated itself
- this worked fine, except when the stop came from the supervisor, i.e.
  the recipient was suspended and did not process the ChildTerminated
- so, as the mirror of Supervise() that it is, I changed
  ChildTerminated() to be a system message and instead of stopping
  processing normal messages by checking the stopping flag, just suspend
  the actor while awaiting the ChildTerminated's to flow in.
2011-12-03 18:53:04 +01:00
Patrik Nordwall
1f665ab4c6 Changed signatures of Scheduler for better api of by-name blocks 2011-12-02 17:13:46 +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
Patrik Nordwall
80ac1737cd First walk throught of FIXME. See #1378
* Fixed obvious
* Created tickets for several, #1408, #1409, #1410, #1412, #1415, 1416, #1418
* Moved LoggingReceive from akka.actor to akka.event
* Touched several of the FIXME to make them visible in code review
2011-11-30 10:48:26 +01:00
Henrik Engstrom
7ca5a4161b Introduced Duration instead of explicit value + time unit in HWT, Scheduler and users of the schedule functionality. See #1291 2011-11-23 11:07:16 +01:00
Patrik Nordwall
e5f8a41cb8 Remove default time unit in config. All durations explicit. See #1363
* Also changed in dispatcher to use explicit Duration instead of Int/Long
2011-11-21 15:18:52 +01:00
Patrik Nordwall
a9217cec7b Merge branch 'master' into wip-1141-config-patriknw
Conflicts:
	akka-actor/src/main/scala/akka/actor/ActorSystem.scala
2011-11-19 09:18:57 +01:00
Viktor Klang
9ae3d7feba Fixing (yes, I know, I've said this a biiiiiillion times) the BalancingDispatcher, removing some wasteful volatile reads in the hot path 2011-11-18 17:03:35 +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
Patrik Nordwall
4b8f11ea92 Replaced akka.config with new configuration utility. See #1141 and see #1342
* All default values removed from code and loaded from akka-actor-reference.conf, located in src/main/resources (included in jar)
* Default test configuration included in AkkaSpec instead of using akka.test.conf, avoids problems when running test (in IDE) and forgetting to use -Dakka.mode=test.
* System.properties used first, if availble
* Next step will be to split akka-actor-reference.conf in separate -reference for each module
2011-11-18 10:05:40 +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
62032cb1ff merge system-cleanup into master 2011-11-17 14:38:49 +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
Viktor Klang
18bfa26272 Renaming startsMonitoring/stopsMonitoring to startsWatching and stopsWatching 2011-11-16 16:46:16 +01:00
Viktor Klang
1613ff5111 Making sure that dispatcher scheduling for shutdown is checked even if unregister throws up 2011-11-16 16:19:56 +01:00
Viktor Klang
39b374ba22 Switching to a Java baseclass for the MessageDispatcher so we can use primitive fields and Atmoc field updaters for cache locality 2011-11-16 16:09:58 +01:00
Viktor Klang
13bfee782f Removing Un(der)used locking utils (locking is evil) and removing the last locks from the MessageDispatcher 2011-11-16 15:54:14 +01:00
Patrik Nordwall
a6e75fb702 Added cleanUp callback in Mailbox, dused in ZooKeeper. Some minor cleanup 2011-11-15 14:39:43 +01:00
Viktor Klang
727c7de58d Removing bounded executors since they have probably never been used, also, removing possibility to specify own RejectedExecutionHandler since Akka needs to know what to do there anyway. Implementing a sane version of CallerRuns 2011-11-15 10:32:00 +01:00
Viktor Klang
afe1e37648 BUSTED
!
2011-11-14 19:25:24 +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
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
1ba168774f improve DeadLetter reporting
(since I know now what’s causing these Jenkins failures ;-) )

- include recipient in DeadLetter
- include recipient in calls to enqueue/systemEnqueue
- move DeadLetterMailbox to ActorSystem (saves some space, too)
- hook up DeadLetterMailbox so it sends DeadLetters to app.deadLetters,
  which publishes them on the eventStream
- subscribe TestEventListener to DeadLetter and turn it into Warning

The generated warnings about ChildTerminated are very much correct, they
remind us that we still need to fix supervisor.stop() to await all
children’s death before actually committing suicide.
2011-11-12 10:57:28 +01:00
Roland
e5c3b39502 correct cleanupMailboxFor to reset the system messages before enqueuing 2011-11-11 20:56:48 +01:00
Roland
3808853845 fix some bugs, but probably not the pesky ones
- enqueuing system messages to DeadLetterMailbox was broken in
  principle, but not in practice for the current default deadLetter
  implementation
- add assert that system messages are not enqueued multiple times
- *BusSpec was using incorrect compareSubscribers based on
  identityHashCode, so moved the proper solution out of
  BalancingDispatcher and into akka.util.Helpers and reuse that in all
  places
2011-11-11 17:44:57 +01:00
Roland
53353d7031 rename MainBus to EventStream (incl. field in ActorSystem) 2011-11-10 21:01:37 +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
Viktor Klang
1b730b5c82 Removing Channel(s), tryTell etc, everything compiles but all tests are semibroken 2011-10-31 16:09:51 +01:00