Commit graph

186 commits

Author SHA1 Message Date
Roland
f317aaf711 rewrite mailbox selection logic, see #3342
- add “mailbox-requirement” key to dispatcher section
- split out mailbox section, add akka.actor.default-mailbox
- rewrite findMarker method and use it for Props.create() and getting
  the required mailbox of an actor
- add ProducesMessageQueue trait for MailboxType so that requirements
  can be checked before trying to create the actor for real
- verify actor as well as dispatcher requirements for message queue
  before creation, even in remote-deployed case
- change MessageDispatcher constructor to take a Configurator, add that
  to migration guide
2013-06-02 12:32:04 +02:00
Roland
d10281d0e4 fix some FIXMEs, see #3192
- remove some outdated ones (which were already fixed but not removed)
- make socket options fully configurable in NettyTransport
- also apply socket options to outbound connections, not only the listen
  socket
- remove timeout from taking the lock in RepointableActorRef, because we
  cannot afford to lose system messages anymore, so we should rather
  block the sender
2013-05-28 13:29:09 +02:00
Roland
738796c625 remove NullMessage, see #3281 2013-05-02 18:48:36 +02:00
Björn Antonsson
c3eed374f1 Allow different types of mailboxes on the same dispatcher. See #2687 2013-04-19 13:42:58 +02:00
Viktor Klang
c883705242 #3018 - Enabling -Xlint and dealing with the situation that occurs 2013-03-29 01:43:17 +01:00
Endre Sándor Varga
f8c3717ca1 Changed Failed to be a SystemMessage
- Moved system messages to their own package.
 - All queueing operations are now hidden behind a SystemMessageList value class
 - Introduced dual SystemMessageList types to encode the ordering in the type.
   - Protects against accidentally missed reverse calls or accidentally reversed lists
   - Makes ordering expectations by fields/parameters explicit
 - Fixed serialization tests
 - Fixes to logging in HierarchyStressSpec
2013-03-22 12:02:31 +01:00
Patrik Nordwall
b738487dc8 Add UID to RemoteActorRef, see #3072
* Sending to a previous incarnation of an actor shall fail,
  to make remote actors work the same way as local ones (in
  the sense that after Terminated() the ref is not working anymore)
* Changed equality of ActorRef to take the uid into account
* Parse uid fragment in RelativeActorPath and ActorPathExtractor
* Handle uid in getChild and in RemoteSystemDaemon
* Use toSerializationFormat and toSerializationFormatWithAddress
  in serialization
* Replaced var uid in ActorCell and ChildRestartStats with
  constructor parameters (path)
* Create the uid in one single place, in makeChild in parent
* Handle ActorRef with and without uid in DeathWatch
* Optimize ActorPath.toString and friends
* Update documentation and migration guide
2013-03-21 20:25:16 +01:00
Patrik Nordwall
0f01ffe3a0 Add fail fast checks to prevent null message, see #2800
(cherry picked from commit 5526f9d2a8b01f944ff078ce57f2a03c21649d05)

* Added null check in Envelope.apply
2013-02-20 13:36:42 +01:00
Viktor Klang
e519e3dc3b #2986 - Changing ActorContext and ActorRefFactory's dispatcher to return ExecutionContext 2013-01-31 15:41:31 +01:00
Viktor Klang (√)
664ab76bf5 Merge pull request #1085 from akka/wip-2974-escalate-uncaught-exceptions-√
Making sure that the current Threads' UEH is called when using Akka FJP ...
2013-01-29 03:21:22 -08:00
Viktor Klang
ff540d76ec Making sure that the current Threads' UEH is called when using Akka FJP in Dispatcher as ExecutionContext 2013-01-29 11:26:06 +01:00
Björn Antonsson
3116c7d4c4 Merge pull request #1078 from akka/wip-2919-master-we-get-lingering-dispatchers-ban
Forward port of #2919 Keep the dispatcher inhabitants count balanced.
2013-01-29 02:17:25 -08:00
Björn Antonsson
bd25c94445 Keep the dispatcher inhabitants count balanced. See #2919
Conflicts:
	akka-remote/src/test/scala/akka/remote/UntrustedSpec.scala
2013-01-28 15:06:14 +01:00
Rich Dougherty
7b3ec79c0c Make it easer to override SystemMessage serialization. Fixes #2940
* Make SystemMessage extend Serializable to avoid ambiguity when
    setting serialization-bindings.
  * Set serialVersionUID in SystemMessages and create tests to
    ensure binary formats remain unchanged.
  * Add tests for reference.conf's serialization settings.
  * Make some existing serialization tests more robust.

Removed boilerplate from serialization tests

Use actual reference.conf; tidy up

Make serialization compatible
2013-01-28 13:23:52 +13:00
Patrik Nordwall
db5da848c0 Merge pull request #1033 from akka/wip-def-if-patriknw
Style change of def starting with if
2013-01-18 04:30:43 -08:00
Patrik Nordwall
5dc108567d Style change of def starting with if
* When a def starts with if and is not a oneliner the if
  should be on a new line.
* The reason is that it might be easy to miss the if when
  reading the code.
2013-01-18 13:28:49 +01:00
Viktor Klang
c38be1bc4a Preserving Envelopes in UnstartedActorCell as requested by Mr Pink 2013-01-18 12:17:32 +01:00
Viktor Klang
adfeb2c1f0 #2879 - updating copyright info 2013-01-09 11:38:00 +01:00
Viktor Klang
d0717aaec6 #2776 - deprecating and introducing alternatives for methods and parameters ending with '_?' 2012-12-14 14:55:21 +01:00
Roland
6450831e01 #2778 - make thread names unique per system
The MonitorableThreadFactory.copy method does not take into account the
counter:AtomicLong field, which then always starts out at zero for every
new dispatcher; the PinnedDispatcher creates one dispatcher per actor,
hence resulting in identical thread names if used by multiple actors.
Solution: add the counter to the case class’ arguments
2012-12-06 22:58:43 +01:00
Viktor Klang
84aef55846 Roland found a nasty race between activate in supervisor and locally, this commit should fix it, and rename activate to point 2012-11-23 17:53:33 +01:00
Viktor Klang
8f131c680f Switching to immutable.Seq instead of Seq 2012-11-12 14:17:47 +01:00
Roland
e86144499c remove some FIXMEs
some were left-over residue, some were fixed
2012-10-16 12:06:03 +02:00
Roland
0f04239f67 move Duration classes according to scala 2.10 nightly and remove casts to FiniteDuration, see #2504 2012-10-11 15:18:10 -07:00
Patrik Nordwall
614caa2989 Include dispatcher id in thread name of pinned dispatcher, see #2585
* Additional tests
* Moved id append from createExecutorServiceFactory in
  ThreadPoolExecutorConfigurator to ThreadPoolConfig
2012-10-02 11:37:27 +02:00
Roland
35b7a9e338 second round of FiniteDuration business, including cluster fixes
- make Scheduler only accept FiniteDuration, which has quite some
  knock-on effects
2012-09-18 09:58:30 +02:00
Viktor Klang
4eee04cb60 #2469 - Switching to scala.util.Try instead of Either[Throwable, T] in the codebase 2012-09-06 03:17:51 +02:00
Roland
2089fcf84c fix NullMessage handling to not be logged as AutoReceiveMessage 2012-08-21 14:45:13 +02:00
Roland
6ce38537d1 add more explanation for NullMessage 2012-08-21 14:10:37 +02:00
Roland
f0c370cf87 add NullMessage after Supervise to prevent race, see #2418
- parent just checked for system messages and finds none
- Supervise is enqueued to parent
- Failed is enqueued to the parent
- Failed is processed before Supervise and thus dropped due to
  non-matching UID

remedy is to enqueue NullMessage after enqueuing Supervise but before
really starting the actor, so that if NullMessage overtakes Supervise
the loop in processMailbox will then pick up Supervise next
2012-08-21 13:43:57 +02:00
Roland
853faf815c Merge branch 'wip-2363-actor-identity-fail-∂π' 2012-08-09 18:19:08 +02:00
Viktor Klang
7beff1abe7 Merging with master 2012-08-09 17:08:17 +02:00
Roland
c901980340 fix wrong failure processing after child name reuse, see #2363
- every ActorCell has a UID which is generated from ThreadLocalRandom
  and also sent with Supervise and Failed messages, and the supervisor
  simply does not act upon failures from children whose UID does not
  match
2012-08-09 16:43:12 +02:00
Viktor Klang
9d097bcf50 Making it possible/mandatory to signal which ExecutionContext will actually execute something scheduled 2012-08-08 15:57:30 +02:00
Roland
350407f834 Merge branch 'wip-2336-hierarchy-spec-∂π' 2012-08-08 14:31:46 +02:00
Roland
6145d4313b some cleanup after Viktor’s comments
- remove useless `cause` argument from some akka exceptions
- improve names of some method arguments
- eliminate some closure allocation
2012-08-08 14:13:52 +02:00
Roland
810d65068e test exceptions from actor constructor in hierarchy, see #2336
This has brought to light some interesting effects (aka bugs) both in
the general implementation as well as in previous fixes.
SupervisorHierarchySpec is without TODOs now and GREEN.
2012-08-08 07:48:23 +02:00
Viktor Klang
2af08127de Adding support for task batching complete with tests 2012-08-03 23:33:45 +02:00
Roland
dca8d15c68 Merge branch 'wip-2212-recursive-resume-∂π' into wip-scala210M5-√
only merged so that it compiles, will clean up warnings in the following
commits
2012-07-23 14:17:45 +02:00
Viktor Klang
1261fab3af Removing akka.util.NonFatal and replacing it with scala.util.control.NonFatal 2012-07-22 15:33:18 +02:00
Roland
4bbb1dbcbd rename becomeOpen/becomeSuspended to resume/suspend on Mailbox 2012-07-13 12:25:26 +02:00
Roland
1cb204da49 Merge branch 'master' into wip-2212-recursive-resume-∂π
also split out ChildrenContainer into its own file and add
suspendCounter to UnstartedActorCell
2012-07-05 13:18:19 +02:00
Roland
78a39198f1 another round of fixes due to suspend counting, see #2212
- always suspend/resume for Suspend/Resume/Recreate, no matter which
  state the actor is in, to keep the counter balanced
- preRestart failures are logged but otherwise ignored; there’s nothing
  else (apart from terminating the actor) which we could do at that
  point
- preRestart/postRestart exceptions have their own distinguishable
  subtype of ActorKilledException now
- fix some race conditions in tests to make them produce fewer false
  failures
- remove cruft from SupervisorStrategy and add methods which can
  actually be used to implement your own (with proper warning signs)
2012-07-04 09:20:17 +02:00
Viktor Klang
0bf45a9403 Initial work in moving to scala.concurrent.Await + Awaitable 2012-06-29 16:06:26 +02:00
Viktor Klang
54a3a44bf8 #2292 - Removing akka.util.Duration etc and replace it with scala.concurrent.util.Duration 2012-06-29 13:33:20 +02:00
Viktor Klang
1a7f29aaec Making everything compile and tests pass 2012-06-28 15:33:49 +02:00
Viktor Klang
702b5d9c19 Switching to the embedded jsr166y in scala.concurrent and dropping akka.jsr166y 2012-06-26 18:19:55 +02:00
Viktor Klang
7f429ed63e Merge with master 2012-06-25 12:55:25 +02:00
Roland
b60210362e make system.actorOf() non-blocking (and working), see #2031
- introducing RepointableActorRef, which starts out with an
  UnstartedActorCell which can cheaply be created; the Supervise()
  message will trigger child.activate() in the supervisor, which means
  that the actual creation (now with normal ActorCell) happens exactly
  in the right place and with the right semantics. Messages which were
  enqueued to the dummy cell are transferred atomically into the
  ActorCell (using normal .tell()), so message sends keep working
  exactly as they used to
- this enables getting rid of the brittle synchronization around
  RoutedActorRef by replacing that one with a RepointableActorRef
  subclass which creates RoutedActorCells upon activate(), with the nice
  benefit that there is no hurry then to get it right because the new
  cell is constructed “on the side”

misc fixes:

- InvalidMessageException is now actually enforced when trying to send
  “null”
- Mailboxes may be created without having an ActorCell, which can come
  in handy later, because the cell is only needed when this mailbox is
  going to be scheduled on some executor
- remove occurrences of Props(), which is equivalent to Props[Nothing],
  which is equivalent to «bug»
- add test case which verifies that context.actorOf is still synchronous
- plus all the stuff I have forgotten.
2012-06-13 17:57:56 +02:00
Viktor Klang
4ee2033761 Lots and lots of work to get things to compile without warnings 2012-06-13 15:44:24 +02:00