Commit graph

35 commits

Author SHA1 Message Date
Viktor Klang
3be5c05b76 Removing a wasteful field in ActorCell, preparing to get to 64bytes (cache line glove-fit 2011-11-23 01:18:29 +01:00
Viktor Klang
4e6361acb7 Removing commented out code 2011-11-22 22:28:37 +01:00
Viktor Klang
4fdf698611 Switching to sun.misc.Unsafe as an experiment, easily revertable 2011-11-21 17:49:21 +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
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
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
Patrik Nordwall
a6e75fb702 Added cleanUp callback in Mailbox, dused in ZooKeeper. Some minor cleanup 2011-11-15 14:39:43 +01:00
Viktor Klang
66dd0123bc Temporary fix for the throughput benchmark 2011-11-14 19:19:44 +01:00
Viktor Klang
e40b7cd8d6 Fixing bug where a dispatcher would shut down the executor service before all tasks were executed, also taking the opportunity to decrease the size per mailbox by atleast 4 bytes 2011-11-14 14:09:23 +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
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
aa1b39c97d use actor.self when logging system message processing errors 2011-11-11 11:37:59 +01:00
Roland
53353d7031 rename MainBus to EventStream (incl. field in ActorSystem) 2011-11-10 21:01:37 +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
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
b39bef69ec Fix bug in DeathWatchSpec (I had forgotten to wrap a Failed) 2011-10-21 19:07:17 +02:00
Roland
fc8ab7dad8 fix CallingThreadDispatcher and re-enable its test 2011-10-21 18:47:44 +02:00
Roland
d55f02e6c1 merge master into parental-supervision, fixing up resulting breakage 2011-10-21 15:11:43 +02:00
Roland
172ab31f2a improve some, but tests are STILL FAILING
- AkkaApplication.stop() will stop the guardian; when that stops, it
  will send ChildTerminated to the BubbleWalker, who will then complete
  a Promise
- AkkaApplication.terminationFuture is that Promise and available for
  registration of onComplete callback, used now to shutdown the
  Scheduler
- AkkaSpec extends BeforeAndAfterAll and uses that to call app.stop(),
  exposing atStartup() and atTermination() overridable hooks
- fixed some tests
2011-10-20 20:45:02 +02:00
Viktor Klang
0dc3c5ad3d Removing receiver from Envelope and switch to use the Mailbox.actor instead, this should speed up the BalancingDispatcher by some since it doesn't entail any allocations in adopting a message 2011-10-19 13:19:44 +02:00
Roland
5c823ad50d replace ConcurrentLinkedQueue with single-linked list for Mailbox.systemQueue
cost zero when empty, non-blocking, shave off 84 bytes per actor
2011-10-18 21:21:19 +02:00
Roland
183dfb4d7f remove SystemEnvelope
- channel field was always set to NullChannel and not used
- receiver field is better put into the Mailbox, because there it takes
  space only once per actor
- leaves only the bare SystemMessage to be queued
2011-10-18 16:44:35 +02:00
Viktor Klang
4e960e5364 Changing so that the mailbox status is ack:ed after the _whole_ processing of the current batch, which means that Akka only does 1 volatile write per batch (of course the backing mailboxes might do their own volatile writes) 2011-10-17 19:33:19 +02:00
Viktor Klang
3a543ed23d Relized that setAsIdle doesn't need to call acknowledgeStatus since it's already called within the systemInvoke and invoke 2011-10-15 16:52:28 +02:00
Peter Vlugter
67a9a01bff Merge master into tame-globals branch 2011-10-07 15:59:18 +02:00
Viktor Klang
4313a28fbd Adding final declarations on a number of case-classes in Mailbox.scala, and also made constants of methods that were called frequently in the hot path 2011-10-07 11:34:07 +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
Roland
2252c38477 switch on force inlining of Mailbox one-liners 2011-10-04 19:40:49 +02:00
Roland
4b5c99e9bd optimize Mailbox._status usage
- make Scheduled==4 to allow bitwise operations
- unfold become(status) into three methods for better inlining
- optimize patterns in setAsIdle away: table switch is probably slower
  than a single conditional
- fix LoggingReceiveSpec glitch wrt. async stop()
2011-10-04 19:33:06 +02:00
Viktor Klang
d000a51e92 Removing the AtomicInteger in Mailbox and implementing it as a volatile int + AtomicIntegerFieldUpdater in AbstractMailbox.java 2011-10-04 15:22:41 +02:00
Viktor Klang
6b8ed8601b Tidying up some of the CAS:es in the mailbox status management 2011-10-04 15:02:51 +02:00
Roland
ece571a535 rename {Message,Mailbox}Handling.scala 2011-09-28 21:59:10 +02:00
Renamed from akka-actor/src/main/scala/akka/dispatch/MailboxHandling.scala (Browse further)