Commit graph

191 commits

Author SHA1 Message Date
Johan Andrén
e43f2be6cd
Byte array allocation/copy hunt (#30266)
* Loads of byte array copy/allocations squashed
* Use a central place for the proto unsafe instead of ad hoc
* Extra docs on serializer toBinary about not mutating bytes after returned
* Found some more toArray:s that can potentially benefit from being unsafe
* Array handed to user callback so extra docs needed
* Unsafe reading of underlying bytes of strings fixed
2021-06-02 17:28:37 +02:00
Andrei Arlou
258bac491b
Remove unused imports in tests (#30265) 2021-06-01 13:34:43 +02:00
Johan Andrén
c5655a9ce6
Upgrade to Scala 2.13.5 (#30072) 2021-03-30 20:57:23 +02:00
Andrea Peruffo
da70e0ccd4
Scala 3 cross compatible akka-actor / akka-testkit / akka-actor-tests (#29956)
* Remove @switch when it doesn't take effect
* Use ActorRef.noSender
* Minor tweaks to SchedulerSpec
* Disambiguate TypedActor for Scala 3
* Bump ScalaTest to a version compatible with Scala 3
* Bump ScalaCheck
* Disambiguate Event in SupervisorHierarchySpec
* Scala 3 compatible EventBusSpec
* Prevent private unused variables to be erased by Scala 3
* Bump mockito
* Explicit actorRef2Scala import
* restore original .scalafix.conf
* Scala 3 compatible tailrec
* Reminder to re add switch annotation in case
* Move to nowarn instead of silencer
* Bump to Scala 2.12.13
* Cross compatible annotations
* fix docs generation
* adapt the build for Scala 3
* fix errors but bus
* remove more SerialVersion from trait
* scalacheck only from scalatest
* cross-compile akka-actor-tests
* restore cross-compilation
* early initializers workaround
* scalacheck switch
* cross compatible FSM.State class
* cross compatible LARS spec
* Change results to pass LineNumberSpec
* fix stackoverflow in AsyncDnsResolverIntegrationSpec
* FSM.State unapply
* fix Scala 2.13 mima
* SerialVersionRemover compiler plugin
* removed unused nowarns
2021-02-01 16:38:29 +01:00
Arnout Engelen
31f654768f
Update copyright to 2021 2021-01-08 17:55:38 +01:00
Patrik Nordwall
4fa733c146
Include entries DData Gossip message dynamically based on size, #28421 (#29751) 2020-11-16 12:00:16 +01:00
Patrik Nordwall
29fd7cad65
Log distributed data size, #29736 (#29740) 2020-10-15 08:39:11 +02:00
yiksanchan
4620c64dc6
Simplify code: replace exists with contains (#29729) 2020-10-12 10:28:21 +02:00
Patrik Nordwall
3a7c02014b log-frame-size-exceeding for Artery, #29683 2020-10-05 14:07:26 +02:00
Patrik Nordwall
b7640c3261
another merge test for GCounter, #29616 (#29624) 2020-09-21 16:36:42 +02:00
Arnout Engelen
c41c0420ad
Update scala to 2.13.3 and silencer to 1.7.0 (#28991)
* Update scala to 2.13.3 and silencer to 1.7.0
* Also travis
* Fix various warnings
2020-08-10 12:54:38 +02:00
Johan Andrén
0921786512 Durable pruning fail fix #29270
Failed once when the new cluster node had not joined the cluster yet, so start with waiting for that.
2020-07-13 16:31:11 +02:00
yiksanchan
26db4c1f79
Add type annotation for public method (#29184) 2020-06-05 10:42:11 +02:00
yiksanchan
de7d18667f
cancellable var -> private val (#29041) 2020-05-11 10:17:29 +02:00
kerr
0e4d41ad33
+build Add sort imports support. (#28780)
* Add scalafix plugin for jdk 9.
* Add command alias sortImports.
* Excludes some sources from SortImports.
* Update SortImports to 0.4.0
* Sort imports with `sortImports` command.
2020-04-27 14:32:18 +02:00
ohze.net
ea7205eaf7
dotty phase 2: scalafix ExplicitNonNullaryApply (#28949)
* scalafix ExplicitNonNullaryApply prepare

+ Temporarily use com.sandinh:sbt-scalafix because scalacenter/scalafix#1098
+ Add ExplicitNonNullaryApply rule to .scalafix.conf
+ Manually fix a NonNullaryApply case in DeathWatchSpec that cause
  `fixall` fail because ExplicitNonNullaryApply rule incorrectly rewrite
  `context unbecome` to `context unbecome()` instead of `context.unbecome()`

* scalafix ExplicitNonNullaryApply

fix by enabling only ExplicitNonNullaryApply rule in .scalafix.conf then:
```
% sbt -Dakka.build.scalaVersion=2.13.1
> fixall
```

* scalafmtAll

* Revert to ch.epfl.scala:sbt-scalafix

Co-authored-by: Bùi Việt Thành <thanhbv@sandinh.net>
2020-04-27 12:31:16 +02:00
Patrik Nordwall
4ba835d328
Harden ShardCoordinator state replication, #28856 (#28895)
* Possibility to prefer oldest in ddata writes and reads
  * enabled for Cluster Sharding
* New ReadMajorityPlus and WriteMajorityPlus
  * used by Cluster Sharding, with configuration
  * also possible to define ReadAll in config
2020-04-24 14:19:53 +02:00
Bùi Việt Thành
02b9b30354 scalafix ExplicitResultTypes - for implicit members 2020-04-20 17:59:50 +07:00
Bùi Việt Thành
4df76d6bce scalafix FinalObject 2020-04-20 17:59:49 +07:00
Bùi Việt Thành
46a310e2cc scalafix ConstructorProcedureSyntax
fix by:
+ enabling only ConstructorProcedureSyntax rule in .scalafix.conf
+ then:
```
% sbt -Dakka.build.scalaVersion=2.13.1
> fixall
> scalafmtAll
```
2020-04-20 17:59:49 +07:00
Christopher Batey
cbf9f71c32
External shard allocation strategy (#28211) 2020-01-21 16:08:51 +00:00
Mikhail Limansky
3fccda9f4c Update multi-jmv tests for ScalaTest 3.1.0 2020-01-15 12:31:07 +03:00
Mike Limansky
d9ed927df0 Update to ScalaTest 3.1.0, fix #28289. 2020-01-11 15:15:10 +03:00
Helena Edelson
6bf20f4117 Update all copyright headers to 2020 after new year's #27881 (#28434) 2020-01-02 13:24:59 +01:00
Brian Wignall
fd41299943 Fix typos, via a Levenshtein-style corrector 2019-12-19 01:57:55 -05:00
Johannes Rudolph
702b6a7f41 actor: allow seamless access to untyped extensions given typed ActorSystem (#28294)
* actor: allow seamless access to untyped extensions given typed ActorSystem

* add overrides with concrete type for Java API everywhere
2019-12-05 16:01:22 +01:00
Patrik Nordwall
bb99bdb02f fix race condition in WriteAggregatorSpec, #25581 (#28242)
* sometimes failed: "WriteAggregator with delta must timeout when less than required acks"
* the DeltaNack will trigger immedediate send of Write
* seems to be a race condition of when the probe is receiving the Write
  from the DeltaNack vs the last expected DeltaPropagation
2019-11-25 17:06:27 +01:00
Scala Steward
63df007685 protoc version 3.10.0 2019-10-14 11:11:21 +02:00
Patrik Nordwall
a217d5566e
Remove auto-downing, #27788 (#27855)
* moved to cluster tests, in new package akka.cluster.testkit
* changed config in tests
* migration guide
* documentation clarificiations for Downing and Leaving
* update warnings in Singleton and Sharding
2019-10-03 14:08:43 +02:00
Johannes Rudolph
650068aa45
Convert 2.5.x MiMa excludes to subdirectory style
Using this script:

```sh

set -ex

FILE=$1
DIR=`dirname $FILE`
TMP_FILE=$DIR/_existing.excludes
FINAL_FILE=$DIR/2.5.x.backwards.excludes/_existing.excludes

mv $FILE $TMP_FILE
mkdir $DIR/2.5.x.backwards.excludes
(echo "# This file contains all excludes added before changing to the subdirectory style" && cat $TMP_FILE) > $FINAL_FILE
rm $TMP_FILE
git add $FINAL_FILE
```
2019-10-01 13:59:56 +02:00
Johan Andrén
2503b13138 Try to get root cause of timeout in ReplciatorPruningSpec #26957 2019-09-30 18:18:28 +02:00
Patrik Nordwall
a7c43cf573
Config to exclude class prefix from serialize-messages, #24273 (#27517)
* Config to exclude class prefix from serialize-messages, #24273

* Adding no-serialization-verification-needed-class-prefix, with "akka." included
  by default
* This is important now when we disable Java serialization by default.
  There will be many complaints about Akka internal classes that are not marked with
  NoSerializationVerificationNeeded, and we can't really sprinkle that everywhere.
* Not removing NoSerializationVerificationNeeded usage in Akka classes because that
  may break bin compat, even though it's needed any more.

* fix DisabledJavaSerializerWarningSpec
2019-09-26 22:51:12 +02:00
Patrik Nordwall
89eab3541c
Merge pull request #27511 from akka/wip-27371-DataDeleted-patriknw
API changes related to DataDeleted, #27371
2019-09-11 16:28:17 +02:00
Arnout Engelen
e6859253e5 Update to MiMa 0.6.0 (#27558) 2019-09-11 11:28:12 +02:00
Patrik Nordwall
1d09d2725b API changes related to DataDeleted, #27371
* The reason for this change is that `DataDeleted` didn't extend the
  `UpdateResponse` and `GetResponse` types and could therefore cause problems
  when `Update` and `Get` were used with `ask`. This was also a problem for
  Akka Typed.
* Introduce new messages types UpdateDataDeleted and GetDataDeleted
* Introduce SubscribeResponse because the responses can be both `Changed`
  and `Deleted` are responses to subscriptions. Important for Typed.
2019-09-10 17:09:04 +02:00
Patrik Nordwall
68424b4f55 Complete logging with SLF4J in Typed, #26537
* TestAppender interaction with LoggingEventFilter
  * TestAppender plays the same role as classic TestEventList
* replace Sl4jLoggingEvent.java
  * include MDC in testkit.LoggingEvent to allow for custom filter
    testing MDC
* fix tests
* fix log events in BehaviorSetKit, using SubstituteLogger
* MDC in EventSourcedBehavior
  * using raw MDC to set the persistenceId and persistencePhase fields
  * avoid access to MDC ThreadLocal if log isn't used

* Automatically enable eventStream Slf4jLogger for Typed (PR #27583)
  * amend the ActorSystem config on startup when config akka.use-slf4j=on
    and akka-slf4j in classpath
  * akka.use-slf4j is defined in akka-actor-typed reference.conf
  * also enable the Slf4jLoggingFilter automatically
  * remove config in tests

* Include actor path as akkaSource in MDC (PR #27587)
  * move logger init to ActorContextImpl since not specific to untyped (ActorContextAdapter)
  * careful to not access MDC ThreadLocal if logging isn't used (per message)
  * MDC is cleared (if used) from aroundReceive in ActorAdapter after processing each message
  * also changed MDC for EventSourcedBehavior to rely on context.log and the outer MDC.clear()
  * just removing the MDC values is not enough because the empty Map remains in the ThreadLocal

* Optimization of MDC interceptor (PR #27610)

* Extension methods to Logger as workaround for overload and varargs problem (PR #27605)
  * "ambiguous reference to overloaded definition" for 2 arg method
  * varargs not supported for primitive types
  * providing extension methods info2 and infoN (and friends) via implicit class LoggerOps
    as more convenient workaround for these problems

* New API for Typed LoggingEventFilter (PR #27611)
  * builder style
  * will make it easier to add more conditions
  * all conditions are AND:ed together which makes it easier to define custom filters
  * simplifies the implementation as a bonus
  * javadsl
  * use new api in all tests
  * leeway setting
  * verify that occurrences = 0 works
  * use javadsl in two tests
  * change interceptLogger, and some other feedback

* Testing utility to silence logging until failure (PR #27588)
  * Logback appender that captures all log events and can flush them
    later to other appenders
  * LogCapturing mixin for ScalaTest that flush the captured logging events
    when a test fails. Also clears the captured events after all tests.
  * Configuration in logback-test.xml
  * log capturing for JUnit tests too, using TestRule
  * Silence initial setup logging from Logback
  * make LogCapturing public
  * use LogCapturing in all tests
    * aside from multi-jvm, and a few extending AkkaSpec, so far
  * a few doc tests needed debug level

* mention in migration guide
* rename setLoggerClass to setLoggerName
* check for logback dependency to give nicer error message
* fix filterKeys, deprecated in 2.13
2019-09-06 10:09:54 +02:00
Helena Edelson
7e84d242ac
Scaladoc: Change untyped to classic - General Typed docs cleanup after all API changes #24717 (#27622) 2019-09-04 07:10:57 -07:00
Christopher Batey
6c13949aec Use protobuf3 for internal serialization (#27366)
* Only load akka protobuf serializer if protobuf on the classpath
2019-08-15 17:43:19 +02:00
Christopher Batey
89e269d5d8 Remove catchall silents from prod code (#27432)
* WIP

* Remove catch all silent annocations from prod code
2019-07-30 11:12:23 +02:00
Patrik Nordwall
10c2b0714a reduce message sizes for Gossip and DeltaPropagation in ddata, #27175 (#27176) 2019-07-16 14:22:16 +02:00
Patrik Nordwall
3efc1c2877
Disable Java serialization by default, #22333 (#27285)
* akka.actor.allow-java-serialization = off
* Moved primitive (Long, Int, String, ByteString) serializers
  from akka-remote to akka-actor since they had no dependency
  and are useful also in local systems, e.g. persistence.
  * e.g. needed for persistence-tck
  * less allow-java-serialization=on in tests
* CborSerializable in Jackson/test module for ease of use
* JavaSerializable for Java serialization in tests, already in akka-testkit,
  but misconfigured
* Made tests pass
  * allow-java-serialization=on in akka-persistence
  * allow-java-serialization=on in classic remoting tests
  * JavaSerializable and CborSerializable in other remoting tests
* Added serialization for
  * Boolean
  * java.util.concurrent.TimeoutException, AskTimeoutException
* support for testing serialization with the inmem journal
* utility to verifySerialization, in SerializationTestKit
* remove AccountExampleWithCommandHandlersInState becuase not possible to serialize State when it's not static
  * Effect() is factory in EventSourcedBehavior  class
* test the account examples
* SharedLeveldbJournal.configToEnableJavaSerializationForTest
* support for exceptions from remote deployed child actors
  * fallback to akka.remote.serialization.ThrowableNotSerializableException
    if exception is not serializable when wrapped in system messages from
    remote deployed child actors and Status.Failure messages
  * it's implemented in `WrappedPayloadSupport.payloadBuilder`
* update reference documentation
* serialize-messages=off in most places, separate ticket for
  improving or removing that feature
* migration guide, including description of rolling update

* fix 2.13 compiler error

* minor review feedback
2019-07-11 14:04:24 +02:00
Patrik Nordwall
50e99e08d8 Use short configurable timeout for expectNoMessage #27212 (#27213)
* Use short configurable timeout for expectNoMessage #27212

* consistent with ActorTestKit in Typed

* fix config
2019-06-26 15:35:20 +01:00
Patrik Nordwall
10d32fceb9 scheduleWithFixedDelay vs scheduleAtFixedRate, #26910
* previous `schedule` method is trying to maintain a fixed average frequency
  over time, but that can result in undesired bursts of scheduled tasks after a long
  GC or if the JVM process has been suspended, same with all other periodic
  scheduled message sending via various Timer APIs
* most of the time "fixed delay" is more desirable
* we can't just change because it's too big behavioral change and some might
  depend on previous behavior
* deprecate the old `schedule` and introduce new `scheduleWithFixedDelay`
  and `scheduleAtFixedRate`, when fixing the deprecation warning users should
  make a concious decision of which behavior to use (scheduleWithFixedDelay in
  most cases)

* Streams
* SchedulerSpec
  * test both fixed delay and fixed rate
* TimerSpec
* FSM and PersistentFSM
* mima
* runnable as second parameter list, also in typed.Scheduler
* IllegalStateException vs SchedulerException
* deprecated annotations
* api and reference docs, all places
* migration guide
2019-06-05 11:38:04 +02:00
Patrik Nordwall
375228273f
Improve logging in DistributedData extension (#27051)
* and don't load extension from ClusterReceptionist since that will
  trigger the warning logging if role is defined
2019-06-03 09:31:28 +02:00
Arnout Engelen
814cfa286c Scala 2.13.0 rc2 (#26967) 2019-05-24 08:11:50 +02:00
Patrik Nordwall
71e9bdc262 more classic remoting leftovers
* fix several tests that were using akka.remote.netty.tcp config
* replace akka.tcp with akka in more places
* some doc cross references to remoting.md
2019-05-15 19:34:50 +02:00
Johan Andrén
81b1e2ef9b Internal dispatcher to protect against starvation (#26816)
* Allow for dispatcher aliases and define a internal dispatcher
* Test checking dispatcher name
* MiMa for Dispatchers
* Migration guide entry
* No need to have custom dispatcher lookup logic in streams anymore
* Default dispatcher size and migration note about that
* Test checking exact config values...
* Typed receptionist on internal dispatcher
* All internal usages of system.dispatcher gone through
2019-05-02 22:35:25 +02:00
Christopher Batey
efc3adc08d
Make artery the default remoting (#26772) 2019-05-01 08:12:09 +01:00
Martynas Mickevičius
2184a617a3 Drop MiMa filters for 2.4.x (#26781) 2019-04-23 09:24:29 +02:00
Patrik Nordwall
a5e9741d35 replace unicode arrows again (#26732) 2019-04-15 15:40:26 +00:00