[JAVA-4335] AutomaticPojoCodec nested codec race condition Created: 06/Oct/21 Updated: 09/Oct/23 |
|
| Status: | Backlog |
| Project: | Java Driver |
| Component/s: | Codecs, POJO |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Praveen D | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | external-user | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Quarter: | FY24Q4 | ||||||||
| Documentation Changes Summary: | 1. What would you like to communicate to the user about this feature? |
||||||||
| Description |
|
We are facing NullPointerException while saving and fetching the data using default codec: We are using mongo-reactive-client-4.1.1 library, Kotlin for our application tech stack. Note: |
| Comments |
| Comment by Ross Lawley [ 12/Oct/21 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Could you provide an example of the Pojos you are using? It may be helpful in replicating this issue. Thanks again, Ross | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ross Lawley [ 12/Oct/21 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thanks for the report, I can't see an NPE exception but the stacktrace reports a CodecConfigurtationException. The fix is listed in the exception message:
Explicitly registering the PojoCodec for this class should fix the decoding issue. I will leave this ticket open as the automatic pojo codec should be able to handle this issue and as you state: "The issue is very inconsistent, when one thread try to save it works but when 50 threads try to save it fails with codec encoding issue. Once the encoding issue appeared then most of the request fails. " Many thanks, Ross | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jeffrey Yemin [ 07/Oct/21 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thanks for reporting this issue. We will investigate and get back to you soon. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Praveen D [ 06/Oct/21 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Below given the error details:
|