Fragile window abandonment during concatMap operations; silent data loss
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 38/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- java
- Bereich
- backend-api-design
Rechercherichtung
Beginne damit, die beiden Reproduktionen mit Flowable.window() unter Verwendung von concatMapSingle() und concatMapMaybe() auszuführen, und vergleiche die Varianten von blockingSubscribe(). Verfolge die Wechselwirkung zwischen dem Verwerfen von Fenstern und dem Downstream-Abonnement; abgeschlossen ist die Aufgabe, wenn Fenster nicht stillschweigend verworfen werden oder das Verwerfen den dokumentierten Fehler erzeugt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Combining the Flowable.window() family of operators with any of the Flowable.concatMap*() operators appears to cause window abandonment bugs which are sensitive to how the outer Flowable is processed downstream. This despite the given concatMap lambdas returning an Rx Single/Maybe ready to be subscribed as soon as they are returned and which will signal the upstream window for subscription synchronously.
In the demonstrations below, I subscribe to identical .window().concatMap() constructions with very slightly different downstreams (.blockingSuscribe(System.out::println) vs. .doOnNext(System.out::println).blockingSubscribe()) and they emit drastically different results due to silent data-loss.
Example: Windowing a stream into lists, similar to the buffer() operator.
public static void main(String[] args) {
final var content = Flowable
.rangeLong(0, 100)
.window(10)
.concatMapSingle(Flowable::toList);
System.out.println("Example 1: Expected behavior for concetMapSingle(Flowable::toList)");
content
.doOnNext(System.out::println)
.blockingSubscribe();
System.out.println("Example 2: Window abandonment & data-loss");
content
.blockingSubscribe(System.out::println);
}
Output:
Example 1: Expected behavior for concetMapSingle(Flowable::toList)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
[10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
[20, 21, 22, 23, 24, 25, 26, 27, 28, 29]
[30, 31, 32, 33, 34, 35, 36, 37, 38, 39]
[40, 41, 42, 43, 44, 45, 46, 47, 48, 49]
[50, 51, 52, 53, 54, 55, 56, 57, 58, 59]
[60, 61, 62, 63, 64, 65, 66, 67, 68, 69]
[70, 71, 72, 73, 74, 75, 76, 77, 78, 79]
[80, 81, 82, 83, 84, 85, 86, 87, 88, 89]
[90, 91, 92, 93, 94, 95, 96, 97, 98, 99]
Example 2: Window abandonment & data-loss
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
[10]
[20]
[30]
[40]
[50]
[60]
[70]
[80]
[90]
Example: Windowing a stream into a simple reduction operation.
public static void main(String[] args) {
final var windowSums = Flowable
.rangeLong(0, 100)
.window(10)
.concatMapMaybe(window -> window.reduce(Long::sum));
System.out.println("Example 3: Expected behavior for concetMapMaybe(window -> window.reduce(Long::sum))");
windowSums
.doOnNext(System.out::println)
.blockingSubscribe();
System.out.println("Example 4: Silent data loss");
windowSums
.blockingSubscribe(System.out::println);
}
Output:
Example 3: Expected behavior for concetMapMaybe(window -> window.reduce(Long::sum))
45
145
245
345
445
545
645
745
845
945
Example 4: Silent data loss
45
10
20
30
40
50
60
70
80
90
The flatMap*() family of operators seem less prone to this behavior but don't guarantee to retain the upstream ordering.
Ideally, I'd expect window() to be compatible with concatMap(). But if such is impossible, I'd expect the window-abandonment detection described in https://github.com/ReactiveX/RxJava/wiki/What%27s-different-in-3.0#window-abandonment-in-window to at least signal an error.
- Vorherrschende Sprache
- Java
- Sterne
- 48.2k
- Forks
- 7.6k
- Ø Merge
- 3 Std. 9 Min.
- Gemergte PRs (30 T.)
- 25
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus ReactiveX/RxJava
-
4.x AI Enhancement Streamable
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
ReactiveX/RxJava#8299 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
4.x: FlowableBufferTest > longTimeAction() FAILEDEvtl. wieder frei @akarnokd hat das vor 74 Tagen übernommen, und es ist kein Pull Request offen. Offen4.x Test-Failures
ReactiveX/RxJava#8280 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
4.x Discussion
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
Maintainer antworten meist innerhalb von 1 Tag
-
4.x PR welcome Test Test-Failures
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
ReactiveX/RxJava#8075 · 4 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
4.x: Cache/Replay operators to be more GC friendlyEvtl. wieder frei @DragonFSKY hat das vor 87 Tagen übernommen, und es ist kein Pull Request offen. Offen4.x Enhancement
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
ReactiveX/RxJava#7912 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in ReactiveX/RxJava
Ähnliche Issues
-
[Bug] DefaultSerializationExceptionWrapper does not implement Cleanable, so cleanup() is never invoked by codecsEvtl. vergeben @binbin0325 hat das heute übernommen. Offencomponent/need-triage type/need-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
2026 Error Report
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
triplea-game/triplea#15096 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Bug][API] Switching workflow versions leaves schedules onlineEvtl. vergeben @zhuangchong hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
apache/dolphinscheduler#18731 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Implement JDBC Domain Enums (`SqlCategory`, `SqlExecutionStatus`, `SqlExecutionType`) in Core ModuleOffencore-module enhancement good first issue
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 87/100
sdlc-pro/spring-lens#531 ·
Maintainer antworten meist innerhalb von 1 Tag