akarnokd / akarnokd/reactive4java

Concurrency operators exhibit registration race condition

Offen
#3 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
auto-migrated Priority-Medium Type-Defect
Vorherrschende Sprache
Java
Sterne
3
Forks
0
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

```
Operators working with multiple sources have problem with initial registration.
Depending on the operator.

The first problem is that the registration and remembering is usually not
protected by a lock, or the half constucted defaultobserver escapes. I.e., when
the registration happens, the source might send values immediately.

The second problem is that if a registration triggers execution which brings
the observer into a completed state, any subsequent registrations are
unnecessary, but still happen and will bombard the defaultobserver indefinitely.

Solution:

- protect the sub-registrations with the same observer lock.
- after each registration, check if the observer completed and do not register
further

Therefore the defaultobserver has 5 "messages"

onNext, onError, onFinish, onClose, onRegister

```

Original issue reported on code.google.com by `akarn...@gmail.com` on 4 Apr 2012 at 5:54

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.