[JAVA-4432] The Subscriber of a publisher never gets its onError method called after an MongoTimeoutException Created: 04/Jan/22 Updated: 28/Oct/23 Resolved: 28/Feb/22 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Change Streams |
| Affects Version/s: | 4.3.0 |
| Fix Version/s: | 4.5.1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Filipe Tavares | Assignee: | Ross Lawley |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | external-user | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
| Comments |
| Comment by Jeffrey Yemin [ 23/Mar/22 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
FYI, 4.5.1 has been released with a fix for this issue. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 28/Feb/22 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {'name': 'Ross Lawley', 'email': 'ross.lawley@gmail.com', 'username': 'rozza'}Message: Ensure callback using cluster description is guarded (#878) Getting the description from a cluster can throw a MongoTimeoutException Co-authored-by: Valentin Kovalenko <valentin.kovalenko@mongodb.com> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 28/Feb/22 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {'name': 'Ross Lawley', 'email': 'ross.lawley@gmail.com', 'username': 'rozza'}Message: Ensure callback using cluster description is guarded (#878) Getting the description from a cluster can throw a MongoTimeoutException Co-authored-by: Valentin Kovalenko <valentin.kovalenko@mongodb.com> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ross Lawley [ 11/Feb/22 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi filipe-m-tavares@alticelabs.com, Thanks for the extra information and for persevering with this ticket. I've scheduled it for the next release. Ross | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Filipe Tavares [ 10/Feb/22 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi ross.lawley, The problem still happens in closed version 4.4.0. I already try three different things: 1. killed the docker container, 2. Killed the mongo process inside the docker container and 3. Run the command db.shutdown() in the mongo cli. And in these 3 ways the `onError` is never called. This is the stacktrace for version 4.3.4
And this is the stacktrace for the 4.2.3 version (in which the `onError` is called):
I did a little debugging and in version 4.2.3 the following code inside `recurseCursor()` method of `BatchCursorFlux` is triggered
In version 4.3 and above this code snippet is never called. And as you can see in the stacktrace the driver takes a completely different path when this error (the mongo goes down) occurs. Thnks, Filipe Tavares | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ross Lawley [ 08/Feb/22 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi filipe-m-tavares@alticelabs.com, Thanks for the extra information - as the 4.4.x driver has been released there are no plans to backport fixes to the 4.3.x series of the driver. There is nothing immediately obvious in the changes between 4.2.3 and 4.3.0 to provide insight as to why this error started in the 4.3.0 release. As I've not been able to replicate the issue can I ask for some more information: Did you kill docker or just the mongod process? Does setting a socket timeout in the driver configuration impact the results? Could you paste in the full logging stacktrace? Many Thanks, Ross Note: As, this scenario can't be reproduced on a multi node replicaset and because a single node replicaset is not a normal deployment strategy, I've reduced the priority to P4. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Filipe Tavares [ 08/Feb/22 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi ross.lawley,
But why did you not try in one closed driver version, like 4.3.4 for example? It is happening in this version and it would be important to understand why it occurs. Also because it may be necessary to release a corrective version?
Just one note: I killed the mongo process (in this case running on a docker container) instead of doing a db.shutdown().
Thanks, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ross Lawley [ 07/Feb/22 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi filipe-m-tavares@alticelabs.com, I'm unable to replicate on the master branch - doing a db.shutdown() on a single node replicaset although outputs the server monitor errors it does trigger the onError callback as expected.
It maybe that the issue has been fixed or I'm simply unable to replicate the issue. Ross | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Filipe Tavares [ 24/Jan/22 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi ross.lawley,
The problem that i reported only occurs when you have only one node in replicaset (in your example you have 3 instances of mongo), in my case i only have one as I mentioned before.
I also tested with you scenario (3 nodes in replicaset) and when I stop the primary one the `onError` is indeed called. But when I have only one node in replicaset and I shutdown that node the `onError` is never called. Thank you, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ross Lawley [ 19/Jan/22 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi filipe-m-tavares@alticelabs.com, I tested on the latest 4.3 release (4.3.4) and on the latest release (4.4.1) and wasn't able to replicate the issue. I tweaked your test code like so:
I was able to see the program working correctly and when I stopped the replicaset I observed the latch countdown via calling onError after the server selection timeout of 5 seconds. Could you confirm that it works as expected for you? Ross | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ross Lawley [ 04/Jan/22 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi filipe-m-tavares@alticelabs.com, Thanks for the ticket, I'll review and update with any findings. Ross |