-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: duplicate CompletedFileUpload in publisher if route is delayed (#…
…10713) Fixes #10578 * Fix NPE when part conversion fails Reactor does not like null elements, so if the refCountAwareConvert fails, there would be an NPE. * Fix duplicate CompletedFileUpload in publisher if route is delayed NettyPublisherPartUploadBinder is designed to emit a HttpData every time a piece of the input data is received. The data is then converted to the specified publisher type. For CompletedFileUpload, NettyConvertersSpi checks whether the HttpData is completed, so the output should only include the final HttpData for the particular part. However, when the route has another argument that delays its execution until all parts have been fully received, this assumption fails. The publisher will buffer all the HttpData, and when the conversion happens, all of these HttpData are isComplete (since at that point the full part has been received). This leads to the same CompletedFileUpload being emitted many times. This patch changes NettyPublisherPartUploadBinder to use claimFieldsComplete instead of claimFieldsRaw to ensure that the same part does not appear multiple times in the first place.
- Loading branch information
Showing
2 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters