Commit 338f2a1
authored
Update BlockingFlowableIterable.onNext() to set error before cancel (#7789)
To avoid race with hasNext(), which checks for cancel first before checking for error. For example, in the following case, hasNext() may return false to the caller, making the caller assume the iterable finished successfully.
1. onNext() called cancel
2. hasNext() found the iterable is cancelled
3. hasNext() found that error is null thus returned false to the caller, without throwing the error
4. onNext() set error1 parent e46ea36 commit 338f2a1
File tree
1 file changed
+5
-2
lines changed- src/main/java/io/reactivex/rxjava3/internal/operators/flowable
1 file changed
+5
-2
lines changedLines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
141 | 145 | | |
142 | | - | |
143 | | - | |
| 146 | + | |
144 | 147 | | |
145 | 148 | | |
146 | 149 | | |
| |||
0 commit comments