Commit graph

1794 commits

Author SHA1 Message Date
Johan Andrén
e3dadd981f
Handle SubSource already timed out on failure or completion #29095 (#29605) 2020-09-17 08:37:02 +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
Arnout Engelen
327e16980d
Make warnings in Java code fatal (#28402) 2020-08-04 13:47:38 +02:00
Yufei Cai
58fa1e3604
fix StreamRefs IllegalStateException (#29432)
* Test SinkRefStage in the CumulativeDemand-after-UpstreamFinish scenario
2020-08-03 11:16:03 +02:00
yiksanchan
1d813fd9c2
doc(RetryFlow): explain with more details (#29229) 2020-07-28 17:44:53 +02:00
James Roper
558160702b
Added MergeSequence graph stage (#29247)
Fixes #28769

Use case for this is if you have a sequence of elements that has been
partitioned across multiple streams, and you want to merge them back
together in order. It will typically be used in combination with
`zipWithIndex` to define the index for the sequence, followed by a
`Partition`, followed by the processing of different substreams with
different flows (each flow emitting exactly one output for each input),
and then merging with this stage, using the index from `zipWithIndex`.

A more concrete use case is if you're consuming messages from a message
broker, and you have a flow that you wish to apply to some messages, but
not others, you can partition the message stream according to which
should be processed by the flow and which should bypass it, and then
bring the elements back together acknowledgement. If an ordinary merge
was used rather than this, the messages that bypass the processing flow
would likely overtake the messages going through the processing flow,
and the result would be out of order offset acknowledgement which would
lead to dropping messages on failure.

I've included a minimal version of the above example in the documentation.
2020-07-09 11:52:46 -04:00
Dave Handy
2f2ee9e67c
Change JsonFraming to fail stage if completing within an object #29228 2020-07-03 17:22:40 +02:00
eyal farago
d6fd8c30e0
stream: ensure async boundaries propagate cancellation causes (#29213)
Before, a cancellation cause might be lost if cancellation happened before subscription was completely handled.
2020-06-22 14:02:01 +02:00
contrun
4f2e82e5f6
stream: Unencoded attribute name (#28955) 2020-06-12 13:57:35 +02:00
Ignasi Marimon-Clos
4c5245e61e minor docs fixes 2020-06-08 18:24:53 +02:00
XIAO Yang
6328e0a6d6
Implement throttle for Source(Flow)WithContext (#29107) 2020-06-08 13:30:42 +02:00
Arnout Engelen
afc9813c55
Docs: WithContext (#29088) 2020-06-05 11:31:10 +02:00
Johannes Rudolph
24f2b2e617
stream: cosmetic improvements to FutureFlow (#29068) 2020-05-28 15:42:41 +02:00
Johannes Rudolph
842052d633
Merge pull request #29091 from jrudolph/28993-fix-keepAlive
stream: make keepAlive/IdleInject more reliable against flukes
2020-05-28 14:45:07 +02:00
Johannes Rudolph
87c5844451
stream: avoid getting stuck when doUnwrap returns NEED_WRAP with outstanding data
Refs #29111

This seems only to happen with TLS 1.3. In that case, remaining data in
`transportInBuffer` was left there instead of putting it back onto the
chopping block.

Then `doWrap` was run but `doUnwrap` was never called again because only
the chopping block was checked for outstanding data but not the buffer.
2020-05-27 15:03:07 +02:00
Johannes Rudolph
9beb88fa44
stream: fix half-closed TLS connection spin-loop
Refs #29110

TLSActor could get caught in a spin-loop on connection termination
because there was an implicit assumption that when inbound is closed
(peer has sent `close_notify`), this SSLEngine would also automatically
send a `close_notify` and close the connection.

Therefore, it would stay in `flushOutbound` pumping in a loop.

This is not true anymore with TLS 1.3, more accurately it can be
configured using `-Djdk.tls.acknowledgeCloseNotify` which is `false` by
default leading to half-open connections.

The solution is to not support half-open TLS connections for now and
consider a connection closed as soon as `isInboundClosed` and there's no
outstanding data.

(To support half-open connections, this fix would have to be reverted
and `flushOutbound` fixed accordingly.)
2020-05-27 15:03:07 +02:00
László van den Hoek
7424dfa490
more useful JavaDoc for javadsl Flow (#28577) 2020-05-22 13:56:04 +02:00
Johannes Rudolph
01603ccc90
stream: make keepAlive IdleInject more reliable against flukes
Refs #28993

The previous `nextDeadline - time < 0` required that nanoTime resolution is
actually high enough to see that the deadline had already passed. If it
had not, the current keep alive was missed and also all future ones (until
another a regular element would trigger another push/pull cycle).

Now, with `>=` it also works in that case and just fails noisily if our
assumptions are not true.

It's not clear how it could have happened. On my machine, timers
trigger 1-2 tick-durations too late (but at least ~2ms). How that could be
the same in terms of the nanoTime resolution is hard to see.
2020-05-19 12:29:32 +02:00
eyal farago
de59bb6803
Replace LazyFlow with FutureFlow (#28729)
And implement other lazy flows on top of it

Co-Authored-By: Johannes Rudolph <johannes.rudolph@gmail.com>
2020-05-14 10:28:53 +02:00
Arnout Engelen
9a1d5191b9
Allow taking a stream snapshot of a stream that uses TLS (#29047) 2020-05-13 09:14:04 +02:00
Patrik Nordwall
9677f19d2f
Additional testing of duplicated extensions (#29013)
* Additional testing of duplicated extensions
* explicit $ in config
* log first problem
2020-05-12 09:07:16 +02:00
kerr
bada816714
=build Fix commandAlias for fixall and sortImports (#28984)
* =build Fix commandAlias for fixall and sortImports

* =build Update sortImports to 0.5.0

* Sort imports to handle `javax`.

* fx
2020-05-11 11:47:33 +02:00
Patrik Nordwall
d2afff6bfc
update protobuf 3.11.4
* supposed to be more native image friendly for Cloudstate
2020-05-06 11:05:30 +02:00
contrun
2104849658
add Source.never (#29008)
* add Source.never

* make Source.never single instance, add DefaultAttributes
2020-05-06 10:33:15 +02:00
kerr
6b5d544deb
Add Source.fromJavaStream as convenient method alias (#28881) 2020-04-28 11:15:11 +02:00
contrun
c2945a3e7f
Docs: API docs for asSourceWithContext (#28950) 2020-04-27 16:15:28 +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
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
Jacky Nguyen
89f920a198
SubscriptionTimeout schedule leak in FanoutProcessor #28810 2020-03-31 09:17:50 +02:00
Renato Cavalcanti
1971500827
Merge pull request #28785 from hepin1989/noClosure
=str Don't create closure
2020-03-30 12:03:51 +02:00
Patrik Nordwall
e151536e81 mima: check against 2.6.4, and missing filters 2020-03-27 11:54:42 +01:00
Ignasi Marimon-Clos
f683241c40
Docs: examples for io streams with StreamConverters (#28746) 2020-03-27 09:56:59 +01:00
Yakiv Yereskovskyi
5605f04cb7
allow Source.queue concurrent pushing (#28273) 2020-03-26 10:56:45 -04:00
hepin1989
92cbec8568 =str Don't create closure 2020-03-23 22:28:49 +08:00
Jacek Ewertowski
2cccfa3c29
Stream: Sugar for Sink.ignore #27789, #24986 2020-03-23 13:05:25 +01:00
Eike Wacker
630e712b9f
Allow a read of length 0 in InputStreamAdapter #28751 (#28759) 2020-03-20 11:33:00 +01:00
Ignasi Marimon-Clos
3d8b4360f0
Docs: Example on the as/fromJavaStream operators (#28745) 2020-03-18 15:54:21 +01:00
Arnout Engelen
dba69dba1d
Add docs and examples for RS fromPublisher #25468 2020-03-11 15:56:59 +01:00
Johan Andrén
d26453b5e8
Clean up same thread execution contexts #26690
* deprecate internal sameThread ec and use a new one for all internal use sites
* Use the respective Scala version standard library "same thread" ec 
* fallback to the old inline impl on 2.12 when reflection isn't possible
2020-03-10 15:39:30 +01:00
Johan Andrén
c46861ed26
Add LogWithMarker to Akka Stream #28450 2020-03-05 15:05:05 +01:00
Arnout Engelen
e487088a27
Allow closing StreamConverter InputStream twice #28664 2020-03-04 17:12:50 +01:00
Johannes Rudolph
655dfbc67f
stream: don't create AbruptTerminationException in happy case (#28686)
Turned up in heavy stream materialization churn benchmark.
2020-03-04 17:11:23 +01:00
Johan Andrén
3157b0199b
MapAsync wouldn't complete when upstream does in all scenarios #28657 2020-03-03 17:17:50 +01:00
eyal farago
5bb9a7145a
stream: provide mapMaterializedValue for Graph (#28610) 2020-02-20 13:30:32 +01:00
Arnout Engelen
8a354ec3f0
stream: Improve half-closing of outgoing TCP connections (#28624)
Notably fixes the case where upstream finished before the connection
was successfully established, and avoids RSTing the incoming stream
when the outgoing stream is done (which is now possible due to the
cancellation reason being propagated).
2020-02-20 13:28:21 +01:00
eyal farago
ccd8481fec
stream: add flatMapPrefix operator (#28380) 2020-02-05 15:37:27 +01:00
Patrik Nordwall
f6bea845ca
update MiMa latestPatch (#28534)
* update MiMa latestPatch

* Even later latest

* exclude jdk9 classes in 2.6.x excludes

* mima exclude for SystemMaterializer.materializer type

Co-authored-by: Johan Andrén <johan@markatta.com>
2020-02-04 15:43:13 +01:00