[JAVA-4321] CommandFailedEvent (and debug log) is generated if decoding fails Created: 29/Sep/21  Updated: 28/Oct/23  Resolved: 04/Oct/21

Status: Closed
Project: Java Driver
Component/s: Monitoring
Affects Version/s: None
Fix Version/s: 4.3.3

Type: Bug Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Jeffrey Yemin
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Expected outcome:

For each command sent to the server, the driver should generate either a CommandSucceededEvent or a CommandFailedEvent.  

Actual outcome:

The driver generates both CommandSucceededEvent and CommandFailedEvent.

This can will happen in any situation where the registered Decoder for the response throws an exception decoding the BSON document response.

 



 Comments   
Comment by Githook User [ 04/Oct/21 ]

Author:

{'name': 'Jeff Yemin', 'email': 'jeff.yemin@mongodb.com', 'username': 'jyemin'}

Message: Fixed new tests on 4.3.x branch

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

Comment by Githook User [ 04/Oct/21 ]

Author:

{'name': 'Jeff Yemin', 'email': 'jeff.yemin@mongodb.com', 'username': 'jyemin'}

Message: Either CommandFailed or CommandSucceeded event should be published, not both (#793)

This fixes a bug in the synchronous driver in which the driver sends a CommandSucceededEvent,
followed by a CommandFailedEvent (for the same command) in the case were the server replied
successfully but the Decoder configured to decode the response throws an exception.

JAVA-4321
Branch: 4.3.x
https://github.com/mongodb/mongo-java-driver/commit/951abf7b764a7fc159ef239a96eb4427e0ef9fc1

Comment by Githook User [ 04/Oct/21 ]

Author:

{'name': 'Jeff Yemin', 'email': 'jeff.yemin@mongodb.com', 'username': 'jyemin'}

Message: Either CommandFailed or CommandSucceeded event should be published, not both (#793)

This fixes a bug in the synchronous driver in which the driver sends a CommandSucceededEvent,
followed by a CommandFailedEvent (for the same command) in the case were the server replied
successfully but the Decoder configured to decode the response throws an exception.

JAVA-4321
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/4ac02c5552ec94bc979cdcf066dd313c546689be

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