Commit graph

210 commits

Author SHA1 Message Date
ohze.net
9416dedad7
Use scalafix to update scala 2.13.3, silencer 1.7.0 (#29367) 2020-12-09 09:20:13 +01: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
contrun
11816df236
add lz4 compression for jackson (#29012) 2020-05-22 13:37:22 +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
Bùi Việt Thành
8a40a0ceaa scalafix Any2StringAdd prepare
Remove an unused local variable that cause error when scalafix Any2StringAdd

```
scalafix.internal.v1.FileException: unexpected error processing file /Users/thanhbv/ohze/oss/akka/akka-bench-jmh/src/main/scala/akka/actor/TellOnlyBenchmark.scala
Caused by: org.scalameta.UnreachableError: this code path should've been unreachable
	at org.scalameta.UnreachableError$.raise(package.scala:40)
	at scala.meta.internal.prettyprinters.TreeSyntax$SyntaxInstances.isAmbiguousWithPatVarTerm$1(TreeSyntax.scala:251)
	at scala.meta.internal.prettyprinters.TreeSyntax$SyntaxInstances.guessIsBackquoted(TreeSyntax.scala:273)
  | => aat scala.meta.internal.prettyprinters.TreeSyntax$SyntaxInstances.$anonfun$syntaxTree$1(TreeSyntax.scala:331)
	at scala.meta.prettyprinters.Syntax$$anon$1.apply(Syntax.scala:9)
	at scala.meta.internal.prettyprinters.TreeSyntax$.$anonfun$apply$1(TreeSyntax.scala:1018)
	at scala.meta.prettyprinters.Syntax$$anon$1.apply(Syntax.scala:9)
	at scala.meta.prettyprinters.Api$XtensionSyntax.syntax(Api.scala:11)
	at scalafix.internal.v1.TreePos$.symbol(TreePos.scala:9)
	at scalafix.internal.v1.InternalSemanticDoc.fromTextDocument$1(InternalSemanticDoc.scala:53)
	at scalafix.internal.v1.InternalSemanticDoc.symbol(InternalSemanticDoc.scala:60)
	at scalafix.v1.package$XtensionTreeScalafix.symbol(package.scala:12)
	at scalafix.v1.SymbolMatcher.unapply(SymbolMatcher.scala:16)
	at scalafix.v1.SymbolMatcher.unapply$(SymbolMatcher.scala:15)
	at scalafix.v1.SymbolMatcher$$anon$2.unapply(SymbolMatcher.scala:29)
	at fix.Any2StringAdd$$anonfun$fix$1.applyOrElse(/Users/thanhbv/ohze/oss/scalafix-rules/scalafix/rules/src/main/scala/fix/Any2StringAdd.scala:41)
```
2020-04-20 17:59:50 +07: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
Patrik Nordwall
6361bdb153
Merge pull request #28878 from akka/wip-delivery-log-perf-patriknw
avoid touching MDC for context.log.trace in reliable delivery
2020-04-17 17:35:58 +02:00
Patrik Nordwall
8f640d4442 JMH bench for work pulling, 28725
* also added point-to-point with ask
2020-04-08 17:07:54 +02:00
Patrik Nordwall
5d7ca06ef1 avoid touching MDC for context.log.trace in reliable delivery 2020-04-08 17:02:28 +02:00
Patrik Nordwall
3afa8bfe92
Fix ReliableDeliveryBenchmark on JDK8, #28889 (#28892)
* getSimpleName (used by jmh) doesn't work for nested object on JDK8
2020-04-07 09:09:42 +02:00
Patrik Nordwall
d9f1416252 change %mdc examples, and tests
* if MDC is empty it's confusing with {} because it can be misunderstood
  to be a missing log template parameter
2020-03-27 17:59:58 +01:00
Patrik Nordwall
b1346ad7a7
JMH bench and flight recorder for reliable delivery, #28725 (#28741)
* JMH bench for reliable delivery
* JFR flight recorder for reliable delivery
* disable hi-freq events by default
* CompileJdk9
* fix validateCompile
2020-03-24 07:59:33 +01:00
Johan Andrén
0f4e146623 ByteString performance regression toArray on 2.13 (#28419)
* Benchmark with numbers
* Better optimization, now on par with 2.12
* Simplify
* Review do'hs and unused errors fixed
* Move build up of composite out to setup
* A little thing to make MiMa happy
* Apply suggestions from code review
Co-authored-by: Arnout Engelen <github@bzzt.net>
2020-01-08 14:14:45 +01:00
Helena Edelson
6bf20f4117 Update all copyright headers to 2020 after new year's #27881 (#28434) 2020-01-02 13:24:59 +01:00
Patrik Nordwall
c84e4d82fb use %mdc logback config to output all MDC entries
* change logback doc example configurations
* change logback test configurations
* change docs around MDC
* change Slf4jLoggerSpec to use this instead
2019-12-05 11:47:37 +01:00
Johan Andrén
a9db32e792
Avoid falling back to IterableOnceOps.copyToArray #28114 2019-11-06 21:18:49 +01:00
Johan Andrén
6190f0bc58 Provide Scheduler implicitly from implicit typed actorsystem (#27986) 2019-10-14 16:33:06 +02:00
Patrik Nordwall
dfaee6f9a1
Make SingleConsumerMultiProducer the default mail box for typed (#27857)
* Merge benchmark projects

* Make SingleConsumerMultiProducer the default mail box for typed

* Make SingleConsumerMultiProducer the default mail box for typed

* Add default mailbox back to classic + define default mailbox for typed in reference

* Fix custom dispatcher
2019-10-09 11:17:50 +02:00
Patrik Nordwall
ae70a833fe
Prepare for other compression algorithms in JacksonSerializer, #27066 (#27889)
* change config structure to be able to support other compression
  algorithms, such as lz4 in the future
* enable compression for json (as before) but disable it by default
  for cbor

Co-Authored-By: Ignasi Marimon-Clos <ignasi@lightbend.com>
2019-10-08 11:23:01 +02:00
Marcos Pereira
92b9db5858 Jackson 2.10.0 (#27814)
* Update Jackson to 2.10.0

* Support configuration for new features introduced in Jackson 2.10

* WRITE_DURATIONS_AS_TIMESTAMPS is the new config used to serialize durations

Previously WRITE_DATES_AS_TIMESTAMPS was used for both date/time and duration, but
in Jackson 2.10 WRITE_DURATIONS_AS_TIMESTAMPS is used for durations, so it needs to
be configured consistently with WRITE_DATES_AS_TIMESTAMPS.
2019-10-02 19:58:11 -07:00
Christopher Batey
dd5a3875ba Make SingleConsumerMultiProducer the default mail box for typed 2019-10-02 11:26:47 +01:00
Christopher Batey
7ac4bde963 Merge benchmark projects 2019-10-02 11:24:51 +01: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
Nicolas Vollmar
751918e84c Deprecates status message based api #27503 (#27519)
* Deprecates status message based api #27503
* Deprecates actorRefWithAck for actorRefWithBackpressure
2019-09-10 11:59:19 +02:00
Johan Andrén
ed955e0da4 Propagate downstream cancellation failures (#27547)
* Add doc clarification about IOResult on sources
* Better error message for IOOperationIncompleteException

Co-Authored-By: Johannes Rudolph <johannes.rudolph@gmail.com>
2019-09-05 20:55:48 +02:00
Johan Andrén
b68d67008a
Deprecate actor materializer (#27538) 2019-09-05 16:08:37 +02:00
Johan Andrén
84cd059bb2
Remove the Artery flight recorder (#27591) 2019-09-05 13:11:22 +02:00
Johan Andrén
aca63ea198
Materializer settings as attributes (#27499)
* Replace MaterializerSettings with Attributes #25559 
 * Field access to settings deprecated to make stages use attributes instead
 * Internal stages updated to use attributes
 * Docs on ActorMaterializerSettings updated to recommend away from using it
 * Verify all stages stopped after each testcase in FlowGroupBySpec
 * Subscription timeout attributes merged into one
2019-09-04 13:37:06 +02:00
Helena Edelson
d12bc13fcb Fix akka-bench-jmh warnings. (#27438) 2019-08-02 10:44:27 +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
f9d76aa030
Log Dropped from DeadLetterListener, #26432 (#27160)
* Log Dropped from DeadLetterListener, #26432

* Move Dropped from akka-actor-typed to akka-actor
* Use it in Artery
* Use in right way from GroupRouter, not via deadLetters
* Remove "without sender" in log message from DeadLetterListener,
  since there is no sender in Typed
* mima filter
* add sender to Dropped
2019-07-04 14:52:42 +02:00
Patrik Nordwall
57fd889548
remove Jackson afterburner, since no visible improvement #24155 (#27064)
* remove Jackson afterburner, since no visible improvement #24155

* add back timeMessage benchmark

* improve custom mapper test
2019-06-13 21:53:21 +02:00
Patrik Nordwall
6660e8504a
Remove Jackson Smile format, #24155 (#27105)
* No clear advantage over CBOR
* One less choice for users
* CBOR seems to have a stronger specification and therefore potential
  for wider adoption
* Performance of CBOR is equals to Smile
* Smile can be slightly more compact
  (I think it does more to reduce repeated field names),
  but that might be better to solve with good compression
2019-06-13 17:40:24 +02:00
Christopher Batey
6e93bef605
Enable Jackson for 2.13 (#27136)
* Enable jackson for 2.13

* Fix 2.13 warnings in jackson module
2019-06-13 16:17:04 +01:00
Patrik Nordwall
41600d3079 use ISO-8601 date/time format in Jackson serializer, #24155
* better for interoperability
* deserialization from both formats are supported
2019-06-07 16:51:44 +02: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
Christopher Batey
e7672a9802
Remove various features deprecated since 2.5.0 (#27023)
* Remove various features deprecated since 2.5.0
2019-05-29 07:10:40 +01:00
Patrik Nordwall
6122966fca Jackson serializer as replacement for Java serialization, #24155
* Copied from Lagom, with the following differences
  * Jsonable and CompressedJsonable not included
  * pcollection and guava modules not enabled by default
  * added scala and afterburner modules
* JSON, CBOR and Smile options (different serializers)
* JMH benchmark
* jackson version 2.9.9
* test polymorphism
* serializer for ActorRef
* Address serializer
* FiniteDuration serializer, same as java.time.Duration
* use blacklist from Jackson databind against gadgets
* disallow binding to open ended types, such as java.io.Serializable
* Configurable ObjectMapper ser/deser features
* testing date formats with WRITE_DATES_AS_TIMESTAMPS on/off
* ActorSystemSetup for ObjectMapper creation
  * and possibility to lookup created ObjectMapper via ObjectMapperProvider extension
* createObjectMapper without ActorSystem, needed by Lagom test
* add basic docs
* skip Scala 2.13 for akka-serialization-jackson for now, until the Jackson
  Scala module has been released
2019-05-24 09:03:45 +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
Arnout Engelen
d3adeb8e0d Clarify docs for Flow.ask generic parameter (#26701)
* Clarify docs for Flow.ask generic parameter

* Java/scala switch

* Throw specific ClassCastException in Flow.ask

Benchmark seems too noisy to draw any real conclusions, but seems not terrible:

```
pre:
Score        Error  Units
[info] AskBenchmark.mapAsync              1    false  thrpt    3  323497.536 ±  38733.024  ops/s
[info] AskBenchmark.mapAsync              1     true  thrpt    3  327001.647 ± 382202.906  ops/s
[info] AskBenchmark.mapAsync              4    false  thrpt    3  457725.806 ±  67583.859  ops/s
[info] AskBenchmark.mapAsync              4     true  thrpt    3  451728.770 ±  74886.315  ops/s

post:
[info] Benchmark              (parallelism)  (spawn)   Mode  Cnt       Score        Error  Units
[info] AskBenchmark.mapAsync              1    false  thrpt    3  338509.183 ± 160893.556  ops/s
[info] AskBenchmark.mapAsync              1     true  thrpt    3  345710.807 ± 505445.147  ops/s
[info] AskBenchmark.mapAsync              4    false  thrpt    3  737276.613 ±   3306.911  ops/s
[info] AskBenchmark.mapAsync              4     true  thrpt    3  697960.417 ± 454528.184  ops/s

[info] Benchmark              (parallelism)  (spawn)   Mode  Cnt       Score        Error  Units
[info] AskBenchmark.mapAsync              1    false  thrpt    3  349120.202 ± 111625.074  ops/s
[info] AskBenchmark.mapAsync              1     true  thrpt    3  440218.776 ± 817228.408  ops/s
[info] AskBenchmark.mapAsync              4    false  thrpt    3  665269.418 ±  10502.449  ops/s
[info] AskBenchmark.mapAsync              4     true  thrpt    3  471313.943 ±  35173.757  ops/s

```

* Formatting, use tag.runtimeClass
2019-05-08 18:57:31 +02:00
Patrik Nordwall
82c761f026
remove Future from StreamRefs mat val, #24372 (#26847) 2019-05-02 16:54:37 +02:00
Kopaniev Vladyslav
897fecdd97 Use BenchTestSource in streams JMH benchmarks #26563 2019-04-05 11:04:25 +02:00
Auto Format
75579bed17 format source with scalafmt, #26511 2019-03-15 10:23:46 +01:00
Auto Format
ce404e4f53 format source with scalafmt 2019-03-11 16:58:55 +01:00
Patrik Nordwall
5c96a5f556 replace unicode arrows
* ⇒, →, ←
* because we don't want to show them in documentation snippets and
  then it's complicated to avoid that when snippets are
  located in src/test/scala in individual modules
* dont replace object `→` in FSM.scala and PersistentFSM.scala
2019-03-11 16:58:51 +01:00
Johan Andrén
a8291f323f Typed only on Scala 2.12
* Typed modules not compiled on 2.11
* Dependent modules also not on 2.11:
  * docs
  * akka-bench-jmh split into a separate one for typed

Still doesn't work because something with sbt
2019-02-21 15:47:09 +01:00
Johan Andrén
9fc3251a03 Update test and sample usages of ActorRef.? to .ask 2019-02-21 13:55:14 +01:00