Commit graph

160 commits

Author SHA1 Message Date
Viktor Klang
a10ed3c157 Adding some more docs to the SmallestMailboxFirstRouter 2012-03-14 12:52:15 +01:00
Viktor Klang
ae7d31ae17 Introducing so that suspended actorrefs are just better than the dlq 2012-03-14 12:46:22 +01:00
Viktor Klang
59735ad61f Additional simplifications to smallestmailboxrouter 2012-03-14 12:27:28 +01:00
Viktor Klang
37c3648b15 Collapsing some logic 2012-03-14 12:18:28 +01:00
Viktor Klang
b7564d06ce Making sure that the code works.... 2012-03-14 12:00:47 +01:00
Viktor Klang
1415617dee New implementation of smallest mailbox router 2012-03-14 10:42:18 +01:00
Roland
b5826f9bd9 make LoggingReceiveSpec more robust 2012-02-18 22:32:41 +01:00
Roland
0f48b9f3eb make supervisorStrategy of Router configurable, see #1835
- also do not scrap router’s children upon restart
- and add docs and tests
2012-02-18 22:15:39 +01:00
Bruce Mitchener
3d90f480d0 Fix spelling errors. 2012-02-14 19:50:01 +07:00
Roland
11f067abfc fix DefaultResizer.pressure, make ResizerSpec less flaky
- also clean up left-over reference to “buddy-wakeup-threshold”
2012-02-13 20:42:14 +01:00
Roland
bb40c1ae30 tweak ResizerSpec to work better with async Resize(), see #1814
- previously relied on resize() being invoked before enqueueing to the
  mailbox, which is not at all guaranteed any longer.
2012-02-13 15:33:10 +01:00
Roland
b6b438415e fix up FromConfig router: allow empty constructor for Java 2012-02-10 14:55:40 +01:00
Roland
36247b10fe fix some more comments and make Router dispatcher configurable
- assert locking balance when using Unsafe.instance.monitorExit
- add RouterConfig.routerDispatcher
- re-enable “busy” resizer test after switching to BalancingDispatcher
- document resizer asynchronicity and how to configure dispatchers
2012-02-10 14:13:40 +01:00
Roland
bbe221e812 incorporate Viktor’s feedback and fix some stuff
- initial resize should be done directly
- must not require children unconditionally in Router constructor
- ResizerSpec changed timing due to asynchronous resizing, one test
  disabled
- removed pointless volatile write in RouterActorRef
2012-02-09 22:58:28 +01:00
Roland
ca3deb4007 now that was a nice journey (related to #1804)
- first, fix quite some data races in RoutedActorRef wrt. the contained
  ActorCell’s childrenRef field (which is not even @volatile)
- then notice that there still are double-deregistrations happening in
  the dispatcher
- coming finally to the conclusion that the Mailbox should not really
  process all system messages in processAllSystemMessages(): we should
  really really stop after having closed the mailbox ;-)
- added simple test case which stops self twice to keep this fixed
2012-02-09 17:34:14 +01:00
Patrik Nordwall
2a167acd92 Some cleanup and additional tests for Serializable. See #1786
* Tried to add @SerialVersionUID(1L) but that removed static forwarders, due to https://issues.scala-lang.org/browse/SI-4804
* Added Serializable to UntypedActorFactory
* Removed some unecessary Serializable
2012-02-07 10:28:42 +01:00
Patrik Nordwall
9c8c0d42c5 Add @SerialVersionUID to Serializable classes. See #1786
* @SerialVersionUID(1L)
* UntypedActorFactory serialization, and test
* Removed Serializable from Serializers
2012-02-07 10:05:54 +01:00
Jonas Bonér
42f5af7fb0 fixes review comments 2012-02-05 09:19:57 +01:00
Jonas Bonér
f855ff2add Fixed misc stuff after review.
Signed-off-by: Jonas Bonér <jonas@jonasboner.com>
2012-02-04 17:50:11 +01:00
Jonas Bonér
c01ed6b436 Switched to ThreadLocalRandom.
Signed-off-by: Jonas Bonér <jonas@jonasboner.com>
2012-02-03 18:08:43 +01:00
Jonas Bonér
2ec15db091 Merge branch 'master' into wip-fix-multi-jvm-test-jboner 2012-02-03 16:38:28 +01:00
Jonas Bonér
ec7772b786 Fixes bug in RandomRouter.
Fixes an interesting "bug" in RandomRouter. Tests failed on my 12 core Linux box. After some investigation I found that it hanged randomly inside the SecureRandom seed generator.

[JVM-Node4] "main" prio=10 tid=0x0000000001701000 nid=0x1942 runnable [0x00007fee631dc000]
[JVM-Node4]    java.lang.Thread.State: RUNNABLE
[JVM-Node4]   at java.io.FileInputStream.readBytes(Native Method)
[JVM-Node4]   at java.io.FileInputStream.read(FileInputStream.java:236)
[JVM-Node4]   at sun.security.provider.SeedGenerator$URLSeedGenerator.getSeedBytes(SeedGenerator.java:509)
[JVM-Node4]   at sun.security.provider.SeedGenerator.generateSeed(SeedGenerator.java:135)
[JVM-Node4]   at sun.security.provider.SecureRandom.engineGenerateSeed(SecureRandom.java:131)
[JVM-Node4]   at sun.security.provider.SecureRandom.engineNextBytes(SecureRandom.java:188)
[JVM-Node4]   - locked <0x00000007c3d84130> (a sun.security.provider.SecureRandom)
[JVM-Node4]   at java.security.SecureRandom.nextBytes(SecureRandom.java:450)
[JVM-Node4]   - locked <0x00000007c3d843d0> (a java.security.SecureRandom)
[JVM-Node4]   at java.security.SecureRandom.next(SecureRandom.java:472)
[JVM-Node4]   at java.util.Random.nextInt(Random.java:272)
[JVM-Node4]   at akka.routing.RandomLike$class.getNext$2(Routing.scala:466)

Puzzled at first I Googled the problem and found this bug report: http://bugs.sun.com/view_bug.do?bug_id=6521844

In short it is designed to block on /dev/random (on Linux) when the entropy pool is empty until some "environmental noise is gathered".

From the Linux manual:
"Hanging at generateSeed is not a bug, since that's what was designed:
    When the entropy pool is empty, reads from /dev/random will block until
    additional environmental noise is gathered.
    (Source: Linux Programmer's Manual, section 4)"

Fix was to switch to java.util.Random.

Fun one

Signed-off-by: Jonas Bonér <jonas@jonasboner.com>
2012-02-03 14:56:50 +01:00
Roland
45140b465e Merge remote-tracking branch 'origin/master' into wip-1644-programmatic-deploy-∂π 2012-02-03 09:49:04 +01:00
Roland
10974acfe8 make it possible to programmatically deploy (e.g. remotely), see #1644
- add Deploy to Props, which is used as the basis (overridden by
  configuration)
- utilize general mechanism .withFallback (introduced on Deploy,
  RouterConfig and Scope)
- actually pass Props over the wire when deploying remotely in order to
  retain settings (this was an oversight before)
- write tests for the new functionality
2012-02-01 15:19:51 +01:00
Viktor Klang
75e90cccdf Cleaning up the code 2012-02-01 14:04:01 +01:00
Viktor Klang
aca5693ce6 Restructuring the pattern internals so it is modular 2012-02-01 13:37:57 +01:00
Viktor Klang
571af3d8d2 Removing pipeTo from akka.actor, renamed pipeTo(f,a) to pipe(f,a) 2012-01-31 18:56:25 +01:00
Viktor Klang
f7a45c0e8f Removing dead imports from akka-actor 2012-01-25 15:38:04 +01:00
Roland
34a0f005b1 Merge branch 'master' into wip-1581-patterns-ask 2012-01-20 19:29:17 +01:00
Viktor Klang
149fbea5a7 Updating Copyright as per #1660 2012-01-19 18:21:06 +01:00
Roland
1daaee98aa Merge remote-tracking branch 'origin/master' into wip-1581-patterns-ask 2012-01-18 14:20:13 +01:00
Roland
00ec3f89dc move ask machinery from ActorRefProvider to pattern.AskSupport
- now everything is assembled in one spot
- also moved PromiseActorRef and AskTimeoutException from akka.actor
- plus a little boy-scouting
2012-01-18 11:53:45 +01:00
Roland
9c762dec20 polish “ask” pattern, see #1581
- move package objects into their respective package.scala file in the
  right directories
- make implicit conversion as well as explicit facility available under
  the same name akka.patterns.ask for easy import
- revert the logic to produce the Promise for the PromiseActorRef within
  the ActorRefProvider; supporting wrapping of external Promises does
  not seem to justify doing needless extra allocations in case of
  failure
- add scaladocs
- factor out “def provider” into trait ActorRefWithProvider, as it
  didn’t feel right attaching this information “by exception” to
  MinimalActorRef
2012-01-17 17:35:33 +01:00
Patrik Nordwall
d95e0629b5 Removed the RoutedActorRef from RouteeProvider constructor. See #1606 2012-01-17 15:53:12 +01:00
Patrik Nordwall
74382c156a Merge branch 'master' into wip-1606-remote-routers-patriknw
Conflicts:
	akka-remote/src/main/scala/akka/routing/RemoteRouters.scala
2012-01-17 14:55:10 +01:00
Patrik Nordwall
d6708184c6 Minor improvements based on feedback. See #1606 2012-01-17 14:48:46 +01:00
Patrik Nordwall
f01b9486aa Removed create-as and corresponding ActorRecipe. See #1511 2012-01-17 14:27:51 +01:00
Patrik Nordwall
e7a0247c0d Handle remote routers transparently. See #1606
* RemoteRouterConfig wrapper with RemoteRouteeProvider instead if fixed remote routers.
* Had to refactor and introduce RouteeProvider for different implementations of how to create routees.
* Works with Resizer also.
* Added some tests.
2012-01-17 09:11:45 +01:00
Patrik Nordwall
8d10d44929 Support config of custom router. See #1623 2012-01-12 16:37:08 +01:00
Patrik Nordwall
2399f02531 Improvements based on feedback. See #1619 2012-01-12 09:53:53 +01:00
Patrik Nordwall
6a12fb7876 Implemented SmallestMailboxRouter. See #1619 2012-01-11 14:06:47 +01:00
Patrik Nordwall
bc7b5c92a0 Added a comment in CustomRouterConfig as suggested 2012-01-11 11:42:03 +01:00
Patrik Nordwall
409cbaf8e2 Removed exposure of RoutedActorRef in RouterConfig. See #1618 2012-01-11 11:30:32 +01:00
Patrik Nordwall
85b673b63f Improvements based on feedback. See #1557
* Renamed resizeOnNthMessage to messagesPerResize
* Moved resize state from RouterConfig to RoutedActorRef so that Props can be shared
2012-01-11 11:13:03 +01:00
Patrik Nordwall
19845d93e8 Improvements and finalization of dynamically resizable routers, replaces ActorPool. See 1557
* resize on nth message instead of always each message
* improved pressure evaluation
* more tests
* documentation
* removed ActorPool
2012-01-10 15:53:27 +01:00
Patrik Nordwall
8b71bf5bea Implemented dynamically resizable routers. See #1557 2012-01-09 21:07:16 +01:00
Patrik Nordwall
8abcf8ce2a Avoid AtomicInteger overflow in RoundRobinRouter. See #1610 2012-01-09 20:50:18 +01:00
Patrik Nordwall
a8c6a0d891 Java API for RouterConfig. See #1609
* CustomRouterConfig and CustomRoute
* Added create methods in the predefined router objects for java equivalent of apply
* IndexedSeq instead of Vector in public api
2012-01-05 17:54:33 +01:00
Nikolay Botev
4270b6f71b ask 2.1 2012-01-01 22:23:10 -08:00
Roland
023f4eb0ec fix review comments 2011-12-30 00:12:49 +01:00