[JAVA-4908] Ensure no NPE is thrown with SerializedFluxSink Created: 13/Mar/23 Updated: 28/Oct/23 Resolved: 30/Mar/23 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 4.9.1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Ross Lawley | Assignee: | Ross Lawley |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Documentation Changes: | Not Needed |
| Documentation Changes Summary: | 1. What would you like to communicate to the user about this feature? |
| Description |
|
From PR: https://github.com/mongodb/mongo-java-driver/pull/1096 Hi there, We use Mongodb reactive stream driver with akka-stream and had an issue when trying to upgrade our mongodb driver from 4.1.x to 4.9.0. The same code which was working with 4.1.x does not work anymore with 4.9.0. The issue is that when performing a find/distinct which returns null values, when the results are used in a SerializedFluxSink a NullPointerException is thrown and everything stops. This is because SerializedFluxSink.next performs a call to Object.requireNonNull(). To fix this NPE we filter out null values from the results. I'm not sure this is the appropriate way to test/fix, suggestions are welcome. Thanks |
| Comments |
| Comment by Githook User [ 31/Mar/23 ] |
|
Author: {'name': 'Clem', 'email': '716892+imclem@users.noreply.github.com', 'username': 'imclem'}Message: Ensure no NPE is thrown with SerializedFluxSink (#1096) When the FluxSink is an instance of SerializedFluxSink and the results To fix this issue we filter out null values from the results.
|
| Comment by Ross Lawley [ 30/Mar/23 ] |
|
This is a regression we previously did the same filtering in the AbstractSubscription. |
| Comment by Githook User [ 30/Mar/23 ] |
|
Author: {'name': 'Clem', 'email': '716892+imclem@users.noreply.github.com', 'username': 'imclem'}Message: Ensure no NPE is thrown with SerializedFluxSink (#1096) When the FluxSink is an instance of SerializedFluxSink and the results To fix this issue we filter out null values from the results.
|