akarnokd / akarnokd/reactive4java

Concurrency operators exhibit registration race condition

Open
#3 0 comments 0 reactions 0 assignees View on GitHub
auto-migrated Priority-Medium Type-Defect
Dominant language
Java
Stars
3
Forks
0
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the concurrency operators and DefaultObserver registration paths described in the issue, then inspect how sub-registrations and observer completion are synchronized. Reproduce a case where registration immediately emits or completes. Done means registrations are protected by the observer lock and no further sources are registered after completion, with coverage for the five observer messages.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.