Function lookup with an expected output content type modifies the shared cached function wrapper
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Java
- Stelle
- 1.1k
- Fork
- 655
- Merge medio
- 4h 54m
- PR unite (30g)
- 10
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di spring-cloud/spring-cloud-function
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
spring-cloud/spring-cloud-function#1542 ·
I maintainer di solito rispondono entro 1 giorno
-
GcfJarLayout omits GcfJarLauncher$NestedUrlStreamHandlerFactory, causing NoClassDefFoundError under the GCF invokerForse già presa @zemiles l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 32/100
spring-cloud/spring-cloud-function#1544 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
spring-cloud/spring-cloud-function#1538 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Kotlin function wrapper treats empty input as no inputForse già presa @seonwooj0810 l’ha presa oggi. Aperta5.0.x backport bug
Difficoltà 3/5 Mezza giornata Idoneità per principianti 30/100
spring-cloud/spring-cloud-function#1537 ·
I maintainer di solito rispondono entro 1 giorno
-
Default JSON mapper collection limit is hard-coded and replaces all collection deserializationAperta5.0.x backport bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 22/100
spring-cloud/spring-cloud-function#1536 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di spring-cloud/spring-cloud-function
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
bug devops low
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
enhancement
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
MDMesh-app/MDMesh#252 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 80/100
I maintainer di solito rispondono entro 1 giorno