Commit graph

59 commits

Author SHA1 Message Date
Viktor Klang
388ec810bf Fixing inverted logic 2012-01-21 01:13:55 +01:00
Viktor Klang
bcfd70f6e0 Moving debug logging statement back into Mailbox.scala 2012-01-21 01:09:06 +01:00
Viktor Klang
184d15d81e Switching to tail recursion and lowering numer of moving parts 2012-01-21 01:06:32 +01:00
Viktor Klang
149fbea5a7 Updating Copyright as per #1660 2012-01-19 18:21:06 +01:00
Roland
e81791cbb6 fix dormant bug in Mailbox’s error logging
- actor.actor could potentially be null after a failed restart attempt
- fix one case of baroqueness in FaultHandling.scala
2012-01-17 14:07:20 +01:00
Roland
d0498eb32e add Class[_] to LogEvent
- it is customary to use class name for categorizing logs, hence we
  should support it; class is taken from logSource.getClass
- update SLF4J module to use logClass as category and set logSource in
  MDC "akkaSource"
- add docs
2012-01-12 13:29:17 +01:00
Roland
6fddb87fca fix one spurious buglet in CallingThreadDispatcher, see #1375 2012-01-10 13:33:57 +01:00
Patrik Nordwall
c4401f1ca8 Changed so that the configured FQCN of the mailboxType must be a MailboxType, not the Mailbox. See #1458 2011-12-21 19:37:18 +01:00
Patrik Nordwall
d87d9e2e80 Additional feedback, thanks. 2011-12-20 10:12:40 +01:00
Patrik Nordwall
fb510d5018 Unwrap InvocationTargetException in ReflectiveAccess.createInstance. See #1555 2011-12-20 09:59:08 +01:00
Patrik Nordwall
5fd40e53ca Updates after feedback 2011-12-20 09:56:29 +01:00
Patrik Nordwall
83b08b20d9 Added CustomMailbox for user defined mailbox implementations with ActorContext instead of ActorCell.
* Mailbox is still there, with ActorCell, for internal use.
* Implemented durable mailboxes with CustomMailbox
2011-12-19 21:46:37 +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
Roland
92e7693203 Merge remote-tracking branch 'origin/master' into wip-remote-supervision-rk 2011-12-13 16:59:43 +01:00
Roland
11601c2926 fix some FIXMEs
- add Java API for FaultHandlingStrategy.Action values
- verify that Mailbox.debug being a constant elides its printlns
- remove dead code from bubbleWalker
2011-12-10 22:52:49 +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
Viktor Klang
4803ba517c Making sure that it doesn't break for the dlq itself 2011-12-07 16:38:09 +01: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
Roland
ea4d30e732 annotate my new FIXMEs with RK 2011-12-03 22:42:13 +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
e38cd19af9 Merge branch 'master' into wip-ActorPath-rk 2011-12-02 13:31:48 +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
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
Viktor Klang
9afc9dc768 Making sure that all access to status and systemMessage is through Unsafe 2011-11-29 16:51:30 +01:00
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