akarnokd / akarnokd/reactive4java

Concurrency operators exhibit registration race condition

未關閉
#3 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
auto-migrated Priority-Medium Type-Defect
主要語言
Java
星號
3
分支
0
PR 合併指標
30 天內沒有已合併 PR

描述

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

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。