Commit 2ba8bb2
Fix a race condition in OperatorMerge.InnerSubscriber#onError (#5851)
* Fix a race condition in OperatorMerge.InnerSubscriber#onError
Inner subscriber must queue the error first before setting done,
so that after emitLoop() removes the subscriber,
emitLoop is guaranteed to notice the error.
Otherwise it would be possible that inner subscribers count was 0,
and at the same time the error queue was empty.
* Add unit test for OperatorMerge.InnerSubscriber#onError race1 parent a49c49f commit 2ba8bb2
File tree
2 files changed
+32
-1
lines changed- src
- main/java/rx/internal/operators
- test/java/rx/internal/operators
2 files changed
+32
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
847 | 847 | | |
848 | 848 | | |
849 | 849 | | |
850 | | - | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
851 | 853 | | |
| 854 | + | |
852 | 855 | | |
853 | 856 | | |
854 | 857 | | |
| |||
Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1205 | 1205 | | |
1206 | 1206 | | |
1207 | 1207 | | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
1208 | 1236 | | |
1209 | 1237 | | |
1210 | 1238 | | |
| |||
0 commit comments