[JAVA-4241] Race condition in Scala wrapper's FlatMapObservable Created: 17/Jul/21  Updated: 28/Oct/23  Resolved: 29/Jul/21

Status: Closed
Project: Java Driver
Component/s: Scala
Affects Version/s: None
Fix Version/s: 4.3.1

Type: Task Priority: Unknown
Reporter: Roman Tkalenko Assignee: Ross Lawley
Resolution: Fixed Votes: 0
Labels: external-user
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Call sequence that leads to the incorrect behavior

A: Observer[S]#onComplete
A: nestedSubscription = None
B: Observer[T]#onComplete
B: onCompleteCalled == false => B: onCompleteCalled = true
B: nestedSubscription.isEmpty == true => B: observer.onComplete()
A: onCompleteCalled == true => A: observer.onComplete

Failing test with reproduction: pr/761 (fails on master, passes on the linked branch)



 Comments   
Comment by Githook User [ 29/Jul/21 ]

Author:

{'name': 'Ross Lawley', 'email': 'ross.lawley@gmail.com', 'username': 'rozza'}

Message: Fix FlatMapObservableTest

Add header and ensure can run in Scala 2.11

JAVA-4241
Branch: 4.3.x
https://github.com/mongodb/mongo-java-driver/commit/357ce8ba04d147cc77fde42dbdf06e5eddd2840b

Comment by Githook User [ 29/Jul/21 ]

Author:

{'name': 'Roman Tkalenko', 'email': 'rmn.tk.ml@gmail.com', 'username': 'tkroman'}

Message: Fix race condition in FlatMapObservable completion handler

JAVA-4241
Branch: 4.3.x
https://github.com/mongodb/mongo-java-driver/commit/f5c00d7f48d0a2a68b254ce580b5a806f5ca053e

Comment by Githook User [ 29/Jul/21 ]

Author:

{'name': 'Ross Lawley', 'email': 'ross.lawley@gmail.com', 'username': 'rozza'}

Message: Fix FlatMapObservableTest

Add header and ensure can run in Scala 2.11

JAVA-4241
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/e5e2ff243f55c04e6307b57f2ae61aa1fe06c3eb

Comment by Githook User [ 29/Jul/21 ]

Author:

{'name': 'Roman Tkalenko', 'email': 'rmn.tk.ml@gmail.com', 'username': 'tkroman'}

Message: Fix race condition in FlatMapObservable completion handler

JAVA-4241
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/7033c6c2800773b5a9864e88aa2912f4adcfa696

Comment by Roman Tkalenko [ 19/Jul/21 ]

Github PR: https://github.com/mongodb/mongo-java-driver/pull/761

Generated at Thu Feb 08 09:01:34 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.