akarnokd / akarnokd/reactive4java

Concurrency operators exhibit registration race condition

Aperta
#3 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
auto-migrated Priority-Medium Type-Defect
Lingua principale
Java
Stelle
3
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

```
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

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.