Function lookup with an expected output content type modifies the shared cached function wrapper
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 45/100
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Java
- Sterne
- 1.1k
- Forks
- 655
- Ø Merge
- 4 Std. 54 Min.
- Gemergte PRs (30 T.)
- 10
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus spring-cloud/spring-cloud-function
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
spring-cloud/spring-cloud-function#1542 ·
Maintainer antworten meist innerhalb von 1 Tag
-
GcfJarLayout omits GcfJarLauncher$NestedUrlStreamHandlerFactory, causing NoClassDefFoundError under the GCF invokerEvtl. vergeben @zemiles hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 32/100
spring-cloud/spring-cloud-function#1544 · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 55/100
spring-cloud/spring-cloud-function#1538 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Kotlin function wrapper treats empty input as no inputEvtl. vergeben @seonwooj0810 hat das heute übernommen. Offen5.0.x backport bug
Schwierigkeit 3/5 Ein halber Tag Anfängerfreundlichkeit 30/100
spring-cloud/spring-cloud-function#1537 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Default JSON mapper collection limit is hard-coded and replaces all collection deserializationOffen5.0.x backport bug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 22/100
spring-cloud/spring-cloud-function#1536 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in spring-cloud/spring-cloud-function
Ähnliche Issues
-
[FEAT] Lambda: support the nodejs26.x runtimeEvtl. vergeben @lBroth hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
floci-io/floci#9392 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
apache/camel-website#1872 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
-
area/backend component/c8-api kind/task
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
Maintainer antworten meist innerhalb von 1 Tag
-
bug devops low
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag