Commit graph

8012 commits

Author SHA1 Message Date
Roland
829c67f60c fix one leak in RoutedActorRef (didn’t properly say good-bye) 2011-12-03 23:14:52 +01:00
Roland
ea4d30e732 annotate my new FIXMEs with RK 2011-12-03 22:42:13 +01:00
Roland
236ce1557c fix visibility of top-level actors after creation
Obtaining an ActorRef means that its path must be found in look-ups.
Since this is tightly coupled to supervision, the plan of managing /user
and /system actors in special ConcurrentHashMaps did not succeed: the
actor might not yet be supervised when the system is stopped, which
would orphan it; or a look-up directly following its creation would
return deadLetters. Since all of this is not desirable, I changed the
strategy to sending the props and name to the respective supervisor, let
it create the child and hand it back, i.e. I’m using ask/get with
ActorTimeout. This is okay since top-level should not be created at MHz
rate (will have to document this, though).

- also fix one expected exception in TypedActorSpec and the names of
  configured routers
2011-12-03 22:25:18 +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
ed4e302d2a make HashedWheelTimer reliably shutdown
- make “shutdown” a normal boolean
- use lock.readLock() whenever reading “shutdown”
- use lock.writeLock() when setting it to true
- throw IllegalStateException whenever no-queue
2011-12-03 21:17:22 +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
Roland
3d0bb8b415 implement ActorSeletion and document ActorRefFactory
- implementation of this cool feature is now astonishingly simple:
  context.actorSelection("child/*") ! msg
- docs propagate to ActorSystem/ActorContext
2011-12-03 17:39:52 +01:00
Roland
79e5c5d0d1 implement coherent actorFor look-up
- look-up of all actor paths in the system, even “synthetic” ones like
  “/temp”
- look-up by full URI (akka://bla/...), absolute or relative path
- look-up by ActorPath
- look-up by path elements
- look-up relative to context where applicable, supporting ".."
- proper management of AskActorRef

Have a look at ActorLookupSpec to see what it can do.
2011-12-03 12:23:23 +01:00
Roland
a3e6fca530 rename RefInternals to InternalActorRef and restructure
- IAR is subclass of AR and SAR
- all concrete ARs implement IAR
- move sendSystemMessage to IAR

all in preparation for unifying the ActorPath look-up for local&remote
actor refs
2011-12-02 14:45:10 +01:00
Roland
e38cd19af9 Merge branch 'master' into wip-ActorPath-rk 2011-12-02 13:31:48 +01:00
Roland
cf020d708a rename top-level paths as per Jonas recommendation
/user
/system
/null
/temp
/remote
/service

multi-jvm tests are disabled for the time being until remote look-up has
been really implemented
2011-12-02 12:24:47 +01:00
Patrik Nordwall
db075d094a Updated to latest config lib 38fb8d6 2011-12-02 12:09:10 +01:00
Patrik Nordwall
eebe068aa5 Nice looking toString of config settings. See #1373 2011-12-02 12:09:09 +01:00
patriknw
d85f8d74b8 Merge pull request #134 from jboner/wip-1404-memory-leak-patriknw
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 01:34:52 -08:00
Patrik Nordwall
79866e5729 Made DefaultScheduler Closeable 2011-12-02 10:32:17 +01:00
Patrik Nordwall
639c5d6a54 Revert the removal of akka.remote.transport. Will be used in ticket 1424 2011-12-02 10:16:21 +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
patriknw
035f514843 Merge pull request #131 from jboner/wip-1378-fixme-patriknw
First walk through of FIXME. See #1378
2011-12-02 00:28:20 -08:00
Patrik Nordwall
fd82251501 Minor fixes from review comments. 2011-12-02 09:26:56 +01:00
Patrik Nordwall
82bbca43ab Merge branch 'master' into wip-1378-fixme-patriknw
Conflicts:
	akka-actor/src/main/scala/akka/actor/ActorRef.scala
	akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala
	akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala
2011-12-02 09:03:03 +01:00
patriknw
b70faa4e42 Merge pull request #129 from jboner/wip-config-patriknw
Updated to latest config lib and changed how reference config files are loaded.
* Config lib 4f3a91f
* All reference files named reference.conf, all will be loaded
* Usage of ConfigFactor.load as default way
* Extensions use same config as ActorSystem.settings.config
2011-12-01 23:53:49 -08:00
Patrik Nordwall
66bf11681c Changed config.toValue -> config.root 2011-12-02 08:51:51 +01:00
Patrik Nordwall
c5a367ad54 Merge branch 'master' into wip-config-patriknw 2011-12-02 08:49:34 +01:00
Viktor Klang
d626cc2455 Removing suspend and resume from user-facing API 2011-12-02 01:27:42 +01:00
Viktor Klang
879ea7c2b4 Removing startsWatching and stopsWatching from docs and removing cruft 2011-12-02 01:04:33 +01:00
Viktor Klang
fcc6169ede Removing the final usages of startsWatching/stopsWatching 2011-12-02 01:00:55 +01:00
Viktor Klang
54e2e9a357 Switching more test code to use watch instead of startsWatching 2011-12-02 00:25:17 +01:00
Viktor Klang
571d856f54 Removing one use-site of startsWatching 2011-12-01 23:52:16 +01:00
Viktor Klang
bf7befc690 Sprinkling some final magic sauce 2011-12-01 23:43:56 +01:00
Viktor Klang
ef27f865d4 Adding support for ForkJoinPoolConfig so you can use ForkJoin 2011-12-01 17:03:30 +01:00
Viktor Klang
e3e694d1dc Tweaking the consistency spec for using more cores 2011-12-01 17:02:30 +01:00
Roland
6b9cdc5f65 fix ActorRef serialization
- represent it by SerializedActorRef(path), i.e. only a “tagged” string
- remove serialize/deserialize from ActorRefProvider interface
- adapt test since deadLetters is returned when nothing found instead of
  exception
- multi-jvm tests are still broken, but that is due to look-up of remote
  actors, which I have just not done yet
2011-12-01 14:31:02 +01:00
Viktor Klang
e590a4877a Making the ConsistencySpec a tad more awesomized 2011-12-01 10:27:28 +01:00
Roland
b65799c7f3 remove ActorRef.address & ActorRef.name
- address => path.toString
- name => path.name
- forward hashCode, equals and compareTo to path
- implement recursive efficient ActorPath.compareTo
- fix ActorPath.equals endless recursion
- remove wrong warning in ActorCell.systemInvoke.supervise()
2011-11-30 23:30:56 +01:00
Roland
7e4333a612 fix actor creation with duplicate name within same message invocation
- ActorCell will pre-fill the childrenRefs with the reserved name in
  order to detect duplicates
- also clean up some test outputs (some ActorSystems forgot to fall back
  to testConf so they did not get the TestEventListener anymore)
- fix race in start-up of LoggingReceiveSpec by ignoring messages from
  testActor start (never was slow enough on my machine to trigger =>
  thank you Jenkins, again!)
- represent actors in logging only by their path, i.e. remote Actor[...]
  decoration
- fix automatic naming of AkkaSpec ActorSystems after the true class
  name of the test spec
2011-11-30 22:19:48 +01:00
Viktor Klang
b42c6b6bd1 Adding the origin address to the SHUTDOWN CommandType when sent and also removed a wasteful FIXME 2011-11-30 18:23:58 +01:00
Viktor Klang
e3fe09f9bd Merge branch 'master' of github.com:jboner/akka 2011-11-30 18:10:46 +01:00
Viktor Klang
16dee0e481 #1409 - offsetting the raciness and also refrain from having a separate Timer for each Active connection handler 2011-11-30 18:05:11 +01:00
patriknw
67cf9b5b55 Merge pull request #127 from jboner/wip-1380-scheduler-dispatcher-patriknw
Execute scheduled tasks in system default dispatcher. See #1380
2011-11-30 06:25:38 -08:00
Patrik Nordwall
b3107aed73 Merge branch 'master' into wip-1380-scheduler-dispatcher-patriknw 2011-11-30 15:18:22 +01:00
Roland
97789dda80 fix one typo and one bad omission:
if you override a method and use a more specific return type, scalac
will emit a bridge method with the expected signature pointing to the
more specific one, but currently this does upset the Eclipse based
Java builders, so add one type ascription to ExtensionKey.
2011-11-30 15:03:33 +01:00
Henrik Engstrom
99e5d88ace Removed obsolete samples, see #1278 2011-11-30 11:37:42 +01:00
Henrik Engstrom
4e49ee6e30 Merge pull request #130 from jboner/samples-henrikengstrom
Samples henrikengstrom
2011-11-30 02:08:55 -08:00
Henrik Engstrom
e4ea7ac5d6 Merge branch 'master' into samples-henrikengstrom
Conflicts:
	akka-actor/src/main/scala/akka/routing/Routing.scala
	akka-samples/akka-sample-ants/README.md
	akka-samples/akka-sample-ants/src/main/scala/Ants.scala
	akka-samples/akka-sample-camel/src/main/scala/sample/camel/Actors.scala
	akka-samples/akka-sample-camel/src/main/scala/sample/camel/Boot.scala
	akka-samples/akka-sample-camel/src/main/scala/sample/camel/ClientApplication.scala
	akka-samples/akka-sample-camel/src/main/scala/sample/camel/ServerApplication.scala
	akka-samples/akka-sample-camel/src/main/scala/sample/camel/StandaloneApplication.scala
	akka-samples/akka-sample-chat/src/main/scala/ChatServer.scala
	akka-samples/akka-sample-osgi/src/main/scala/OsgiExample.scala
	akka-samples/akka-sample-remote/src/main/scala/ServerManagedRemoteActorSample.scala
	project/AkkaBuild.scala
2011-11-30 11:05:13 +01:00
Viktor Klang
070d446165 #1417 - Added a test to attempt to statistically verify memory consistency for actors 2011-11-30 10:52:51 +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
9e5c2f15fd Changed LinkedList to Iterable in constructor, see #1278 2011-11-30 08:35:40 +01:00
Roland
073c3c012b fix EventStreamSpec by adding Logging extension
- used only to keep the uniquifying logger counter per-ActorSystem
- add convenience-class for writing an extension with only two lines
  overhead (Java: three)!
2011-11-29 23:00:57 +01:00
Roland
afda539324 merge master into wip-ActorPath-rk 2011-11-29 21:52:18 +01:00
Henrik Engstrom
5cc36fa476 Added todos for 2.0 release, see #1278 2011-11-29 17:12:57 +01:00