Repository navigation
Conversation
…wrapper A singleton lookup that specifies output MIME types now returns a separate FunctionInvocationWrapper with those types. The wrapper reuses the same target, preserves composition, conversion, and header settings, and has its own invocation state. Lookups without MIME types still return the cached singleton wrapper. Regression tests cover concurrent lookups, isolation of conversion settings, and JSON output from a composed function. Fixes spring-cloud#1534 Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
A caller requesting JSON could receive plain text if another caller looked up the same function before the first caller invoked it. A caller that specified no output format could also inherit an earlier caller's choice.
SimpleFunctionRegistry.doLookup stored the requested MIME types on the cached singleton wrapper. Each lookup that supplied MIME types overwrote the shared field, and a lookup that omitted them left the previous value in place.
Summary of the fix
A singleton lookup that specifies output MIME types now returns a separate FunctionInvocationWrapper with those types. The wrapper reuses the same target, preserves composition, conversion, and header settings, and has its own invocation state. Lookups without MIME types still return the cached singleton wrapper. Regression tests cover concurrent lookups, isolation of conversion settings, and JSON output from a composed function.
Verification
mvnwlocally for the spring-cloud-function SimpleFunctionRegistry change; it passed.Resolves #1534