Function lookup with an expected output content type modifies the shared cached function wrapper
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
Start in SimpleFunctionRegistry.doLookup(..) and the wrappedFunctionDefinitions cache it reads from, listing every mutable per-lookup field on the wrapper (expectedOutputContentType, skipInputConversion, skipOutputConversion, the input header enhancer, propagateInputHeaders). Then trace where the invocation applies those settings to see whether they can be passed per call instead of stored. The fix is done when a new test looks up one function concurrently with different expected content types and each result keeps its own, with existing registry tests still green.
由索引模型根據 Issue 內容生成。
描述
SimpleFunctionRegistry.doLookup(..) assigns the requested output mime types to the wrapper it returns (function.expectedOutputContentType = expectedOutputMimeTypes). That wrapper is usually the instance cached in wrappedFunctionDefinitions and shared by all callers, because functions are singletons by default.
This has two consequences:
- concurrent lookups of the same function definition with different expected content types (for example HTTP requests with different
Acceptheaders) overwrite each other's value on one shared, non-volatile field, so a request may be converted to the content type that another request asked for - the field is only assigned when mime types are given and is never reset, so a later lookup without mime types still uses the content type left by an earlier caller
The wrapper holds other per-lookup state with the same problem: skipInputConversion, skipOutputConversion, the input header enhancer and propagateInputHeaders.
Proposed change: do not modify the cached wrapper. Return a lightweight per-lookup view or copy when a lookup needs different settings (or pass the expected content type with the invocation), and add a test that looks up the same function concurrently with different content types and verifies that each result uses its own.
- 主要語言
- Java
- 星號
- 1.1k
- 分支
- 655
- 平均合併
- 4 小時 54 分鐘
- 30 天內合併 PR
- 10
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
spring-cloud/spring-cloud-function 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 70/100
spring-cloud/spring-cloud-function#1542 ·
維護者通常 1 天內回覆
-
GcfJarLayout omits GcfJarLauncher$NestedUrlStreamHandlerFactory, causing NoClassDefFoundError under the GCF invoker可能已有人在做 @zemiles 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 32/100
spring-cloud/spring-cloud-function#1544 · 1 個 reaction ·
維護者通常 1 天內回覆
-
難度 3/5 1-2 天 新手友好度 55/100
spring-cloud/spring-cloud-function#1538 · 1 則留言 ·
維護者通常 1 天內回覆
-
Kotlin function wrapper treats empty input as no input可能已有人在做 @seonwooj0810 今天認領。 未關閉5.0.x backport bug
難度 3/5 半天 新手友好度 30/100
spring-cloud/spring-cloud-function#1537 ·
維護者通常 1 天內回覆
-
5.0.x backport bug
難度 4/5 3-5 天 新手友好度 22/100
spring-cloud/spring-cloud-function#1536 ·
維護者通常 1 天內回覆
查看 spring-cloud/spring-cloud-function 的全部 Issue
相似的 Issue
-
[FEAT] Lambda: support the nodejs26.x runtime可能已有人在做 @lBroth 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 82/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
apache/camel-website#1872 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
-
area/backend component/c8-api kind/task
難度 2/5 1-3 小時 新手友好度 74/100
維護者通常 1 天內回覆
-
bug devops low
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆