Commit graph

48 commits

Author SHA1 Message Date
Patrik Nordwall
5e80bd97f2 Stop unused Artery outbound streams, #23967
* fix memory leak in SystemMessageDelivery
* initial set of tests for idle outbound associations, credit to mboogerd
* close inbound compression when quarantined, #23967
  * make sure compressions for quarantined are removed in case they are lingering around
  * also means that advertise will not be done for quarantined
  * remove tombstone in InboundCompressions
* simplify async callbacks by using invokeWithFeedback
* compression for old incarnation, #24400
  * it was fixed by the other previous changes
  * also confirmed by running the SimpleClusterApp with TCP
    as described in the ticket
* test with tcp and tls-tcp transport
  * handle the stop signals differently for tcp transport because they
    are converted to StreamTcpException
* cancel timers on shutdown
* share the top-level FR for all Association instances
* use linked queue for control and large streams, less memory usage
* remove quarantined idle Association completely after a configured delay
  * note that shallow Association instances may still lingering in the
    heap because of cached references from RemoteActorRef, which may
    be cached by LruBoundedCache (used by resolve actor ref).
    Those are small, since the queues have been removed, and the cache
    is bounded.
2018-02-21 11:59:18 +01:00
Patrik Nordwall
0d222906f4 Prepare Artery for alternative TCP transport, #24390
* Refactoring to separate the Aeron specific things, ArteryAeronUdpTransport
* move Aeron specific classes to akka.remote.artery.aeron package
* move Version to ArterySettings, and describe strategy for envelope header changes
2018-02-20 16:02:57 +01:00
Christopher Batey
009214ae07
Update copyright to 2018 (#24241) 2018-01-04 17:26:29 +00:00
Patrik Nordwall
17f712a76b
Pass HandshakeReq in all inbound lanes, #23527 (#23842)
* Pass HandshakeReq in all inbound lanes, #23527

The HandshakeReq message must be passed in each inbound lane to
ensure that it arrives before any application message. Otherwise there is a risk
that an application message arrives in the InboundHandshake stage before the
handshake is completed and then it would be dropped.

* mima
2017-11-11 10:19:57 +01:00
Guido Medina
9df5d80268 Java 9 Unsafe access to String value type mismatch. (#23710)
It needs to account for both Java 8 and 9 where the types are char[] and byte[] respectively.
2017-09-25 23:22:49 +09:00
Björn Antonsson
f8b4fb55ca Remove use of deprecated Scala features #22581 2017-03-27 19:05:54 +03:00
Konrad `ktoso` Malawski
d306700feb =doc Make it easier to disable Java serialization, #22283 (#22315)
* one single config option to disable it completely
* improve security documentation

Co-authored-by: Patrik Nordwall <patrik.nordwall@gmail.com>
2017-02-16 14:09:04 +01:00
Konrad `ktoso` Malawski
dcd8cea32e #21475 moving compressions ownership to Decoder (#22047)
* WIP early preview of moving compressions ownership to Decoder

* Compression table created in transport, but owned by Decoder
Added test for restart of inbound stream

* =art snapshot not needed in HeavyHitters since owned by Decoder
2017-01-13 10:33:55 +01:00
Philippus Baalman
6c7085252a extended copyright into 2017 2017-01-04 17:37:15 +01:00
Björn Antonsson
8d05592e2e =rem Streamline Artery encoding of metadata to avoid allocations
* Change RemoteInstrument API to work with ByteBuffers
* Remove the MetadataMap since serialization is done in buffer
2016-12-06 10:05:27 +01:00
Konrad Malawski
0127d4f424 +str #18793 StageLogging that allows logger access in stages (#21696)
* +str #18793 StageLogging that allows logger access in stages
Also, non ActorMaterializers can opt-into providing a logger here.

* +str #18794 add javadsl for StageLogging

* fix missing test method on compile only class
2016-10-28 16:05:56 +02:00
Patrik Nordwall
74df8226de add/change private visibility 2016-09-29 11:30:34 +02:00
Patrik Nordwall
1cae346f4d add thread local LRU cache for resolveActorRef 2016-09-28 11:15:54 +02:00
Patrik Nordwall
4cccca8d52 Better to send msg to unresolved ref than dropping it, #21422
* for the remote deployed actors
* e.g. watch of really dead actor
* this doesn't solve the ticket, we will make a better solution later
2016-09-26 12:43:53 +02:00
Patrik Nordwall
30603d194a log-received-messages and log-sent-messages, #21506 (#21508)
* log-received-messages and log-sent-messages, #21506

* also duplicate the trusted settings to artery section
2016-09-23 12:30:54 +02:00
Patrik Nordwall
1926560e41 stop outbound streams when quarantined, #21407
* they can't be stopped immediately because we want to send
  some final message and we reply to inbound messages with `Quarantined`
* and improve logging
2016-09-21 14:38:13 +02:00
Martynas Mickevičius
08670ca155 Add non-local recipient check when handling HandshaleReq (#21497) 2016-09-20 13:23:50 +02:00
Patrik Nordwall
76c23a7880 fix many bugs in InboundCompressions, #21464
* comprehensive integration test that revealed many bugs
* confirmations of manifests were wrong, at two places
* using wrong tables when system is restarted, including
  originUid in the tables with checks when receiving advertisments
* close (stop scheduling) of advertisments when new incarnation,
  quarantine, or restart
* cleanup how deadLetters ref was treated, and made it more robust
* make Decoder tolerant to decompression failures, can happen in
  case of system restart before handshake completed
* give up resending advertisment after a few attempts without confirmation,
  to avoid keeping outbound association open to possible dead system
* don't advertise new table when no inbound messages,
  to avoid keeping outbound association open to possible dead system
* HeaderBuilder could use manifest field from previous message, added
  resetMessageFields
* No compression for ArteryMessage, e.g. handshake messages must go
  through without depending on compression tables being in sync
* improve debug logging, including originUid
2016-09-19 11:37:44 +02:00
Konrad Malawski
c20b6088cd =art add metadata field to the header, #20703 2016-09-16 18:13:23 +02:00
Patrik Nordwall
7b665f705e try delayed retry resolve of remote deployed refs only once, #21403
* If the retried resolve isn't successful the ref is banned and
  we will not do the delayed retry resolve again. The reason for that is
  if many messages are sent to such dead refs the resolve process will slow
  down other messages.
2016-09-09 10:15:12 +02:00
Patrik Nordwall
ebd1883df5 remove or reword obsolete fixme 2016-09-08 18:00:37 +02:00
Endre Sándor Varga
11fceb4121 21203: Cache/memoize ActorRef resolution 2016-09-08 11:41:06 +02:00
Patrik Nordwall
32e852596f harden receive of messages using wrong compression table 2016-09-05 13:29:08 +02:00
Patrik Nordwall
faf941b4c8 support for parallel lanes, #21207
* for parallel serialziation/deserialization
* MergeHub for the outbound lanes
* BroadcastHub + filter for the inbound lanes, until we
  have a PartitionHub
* simplify materialization of test stage
* add RemoteSendConsistencyWithThreeLanesSpec
2016-09-05 12:42:33 +02:00
Konrad Malawski
888ffa5f06 +art enable compression for manifests (#21211) (#21333) 2016-09-02 08:52:09 +01:00
Patrik Nordwall
0c0e3c5efd Refactoring of outbound compression, #21210
* outbound compression is now immutable, by simply using
  CompressionTable[ActorRef] and CompressionTable[String]
* immutable outbound compression will make it possible to use
  them from multiple Encoder instances, when we add several lanes
  for parallel serialization
* outbound compression tables not shared via AssociationState
* the advertised tables are sent to the Encoder stage via async
  callback, no need to reference the tables in other places than
  the Encoder stage, no more races via shared mutable state
* when outbound stream is started or restarted it can start out
  without compression, until next advertisement is received
* ensure outbound compression is cleared before handshake is signaled complete
2016-08-26 15:21:03 +02:00
Patrik Nordwall
57ca273903 adjust the hit count sampling with the rate 2016-07-07 10:29:09 +02:00
Patrik Nordwall
d2657a5969 adaptive sampling of hit counting
* when rate exceeds 1000 msg/s adaptive sampling of the
  heavy hitters tracking is enabled by sampling every 256th message
* also fixed some bugs related to advertise in progress

* update InboundCompression state atomically

* enable compression in LatencySpec
2016-07-05 19:54:53 +02:00
Konrad Malawski
d1015c1dc6 Compression tables properly *used* for Outgoing Compression (#20874)
* =art now correctly compresses and 2 table mode working
* =art AGRESSIVELY optimising hashing, not convienved about correctness yet
* fix HandshakeShouldDropCompressionTableSpec
2016-07-04 16:48:11 +02:00
Patrik Nordwall
b2089d06a7 new OutboundEnvelope
* instead of the old Send
* optional recipient, remove of dummy
* pool of OutboundEnvelope
2016-07-01 14:06:48 +02:00
Patrik Nordwall
9ffe211546 adjust oversized error message 2016-07-01 12:29:05 +02:00
Konrad Malawski
d99274a51f =art #20455 compression tables advertised as a whole "2 tables mode" (#20863)
Squashed commit of the following:

commit 6dc45364eb285338885bc8a5f1c4f293a29a53fb
Author: Konrad Malawski <konrad.malawski@project13.pl>
Date:   Fri Jun 24 19:03:58 2016 +0200

    =art moved successfuly to 2 table mode
    envelope format prepared, versioned tables

    2 table mode working

commit 517723c5d61969988a9a93b99666824bf5bccb52
Author: Konrad Malawski <konrad.malawski@project13.pl>
Date:   Fri Jun 24 10:28:02 2016 +0200

    WIP

commit 3e05a733e087e0d5bd8df9cc4fff0d4bc1314ec8
Author: Konrad Malawski <konrad.malawski@project13.pl>
Date:   Wed May 18 02:28:12 2016 +0200

commit b51f1766a94b202cd42fcc9d5402327ad0800d2d
Author: Konrad Malawski <konrad.malawski@project13.pl>
Date:   Thu Apr 28 10:56:58 2016 +0200

    +art #20455 HeavyHitters and CountMinSketch prepared for Compression
2016-07-01 11:54:57 +02:00
Konrad Malawski
e818887bb2 +art #20455 HeavyHitters, CountMinSketch => ActorRef Compression
* +art #20455 HeavyHitters and CountMinSketch prepared for Compression

* +art #20455 compression tables and integration specs
2016-06-23 11:58:54 +02:00
Johan Andrén
c8eadd7d08 Porting RemotingSpec to artery #20714 2016-06-10 16:27:06 +02:00
Patrik Nordwall
5c234940c6 make remote deployment work with Artery, #20715
There were two related problems with remote deployment when
using Artery.

* DaemonMsgCreate is not a SystemMessage, but must be sent over the control stream because
  remote deployment process depends on message ordering for DaemonMsgCreate and Watch messages.
  It must also be sent over the ordinary message stream so that it arrives (and creates the
  destination) before the first ordinary message arrives.
* The first point solves the creation of the remote deployed actor but it's not enough.
  Resolve of the recipient actor ref may still happen before the actor is created. This
  is solved by retrying the resolve for the first message of a remote deployed actor.
2016-06-10 15:15:57 +02:00
Patrik Nordwall
7a1a316e8a reduce allocations with specialized ImmutableLongMap (#20750)
* reduce allocations with specialized ImmutableLongMap

* backed by arrays, allocation free lookups with binary search
* use it for UID -> Association Map
* pass Association in InboundEnvelope to reduce to only
  one lookup per incoming message
* use ImmutableLongMap instead of the QuarantinedUIDSet
2016-06-10 13:04:23 +02:00
Patrik Nordwall
64a61d5a4c object pool for InboundEnvelope 2016-06-07 18:58:59 +02:00
Patrik Nordwall
a814034342 Option value class, to avoid allocations for optional sender 2016-06-07 18:58:59 +02:00
Patrik Nordwall
3465a221f0 format with new Scalariform version
* and fix mima issue
2016-06-03 12:56:49 +02:00
Patrik Nordwall
7505393c89 initiate new handshake after restart of receiving system, #20568
* we don't want to include the full origin address in each message,
  only the UID
* that means that the restarted receiving system can't initate a
  new handshake immediately when it sees message from unknown origin
* instead we inject HandshakeReq from the sending system once in a while
  (1 per second) which will trigger the new handshake
* any messages that arrives before the HandshakeReq are dropped, but
  that is fine since the system was just restarted anyway
* note that the injected handshake is only done for active connections,
  when a message is sent
* also changed the UID to a Long, but there are more places in old remoting
  that must be changed before we actually can use a Long value

fix lost first message, #20566

* the first message was sometimes dropped by the InboundHandshake stage
  because it came from unknown origin, i.e. the handshake had not completed
* that happended because the ordinary messagage arrived before the
  first HandshakeReq, which may happen since we sent the HandshakeReq
  over the control stream
* this changes so that HandshakeReq is sent over the same stream, not
  only on the control stream and thereby the HandshakeReq will arrive
  before any other message
* always send HandshakeReq as first message
  * also when the handshake on sender side has been completed at startup
  * moved code from preStart to onPull
2016-05-27 17:05:23 +02:00
Patrik Nordwall
a0f8f19e86 change header to use serializer id instead of FQCN
* because FQCN can become a problem for rolling upgrade scenarios
  where you want to rename serializer classes
* also renamed classManifest to manifest because it doesn't have
  to be class names
2016-05-27 12:26:15 +02:00
Patrik Nordwall
aa2c4fe7bf handle serialization errors, #20324 2016-05-27 12:26:15 +02:00
Patrik Nordwall
e74e1da6cc optimize currentTransportInformation 2016-05-27 12:26:14 +02:00
Patrik Nordwall
5b7c978844 add JMH benchmark for encoder decoder stage
* CodecBenchmark that tests encode, decode and combined
  encode + decode
* refactoring of codec stages to make it possible to
  run them without real ArteryTransport
* also fixed a bug in inbound stream for large messages,
  it was using wrong envelope pool
2016-05-27 12:21:30 +02:00
Patrik Nordwall
7288107031 Merge pull request #20572 from akka/wip-serialization-perf-patriknw
improve codec performance
2016-05-20 13:06:47 +02:00
Johan Andrén
cd71643a91 [WIP] Large message stream for Artery (#20545)
* First stab at separate large message channel for Artery

* Full actor paths, no implicit "/user/" part

* Various small fixes after review

* Fixes to make it work after rebasing

* Use a separate EnvelopeBufferPool for the large message stream

* Docs for actorSelection not sending through large message stream
2016-05-20 12:40:56 +02:00
Patrik Nordwall
121840589b improve codec performance
* caching of actor refs in Encoder, Decoder
* dynamicAccess.getClassFor in Serialization is costly,
  so introduced a cache for the class manifests there
2016-05-20 11:40:22 +02:00
Endre Sándor Varga
1828a8def3 Buffer and header parsing support 2016-05-19 13:40:09 +02:00