Thrown StatusRuntimeException loses its trailers when GrpcExceptionHandler returns null

Aperta
#444 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

@beyondwin ci sta già lavorando.

Dal 2/11/2026.

  • #445 di @beyondwin — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
grpc, java, spring-boot
Ambito
backend

Direzione di ricerca

Start with GrpcExceptionHandlerInterceptor and the FallbackHandler it uses when the handler returns null, then compare how the thrown exception's trailers are handled with the trailers of the handler result, as the issue describes around commit 71355e6f and the gh-193 and gh-332 fixes. Done means a test where a handler returns null and a thrown StatusRuntimeException with trailers reaches the client with its trailers intact, matching what responseObserver.onError already does.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Throwing a StatusRuntimeException that carries trailers drops those trailers when GrpcExceptionHandler returns null.

The client still gets the status code and description, but google.rpc.Status details and any custom trailer keys are missing. Calling responseObserver.onError with the same exception keeps them. Returning null is the documented way for a handler to skip an exception it does not classify, and the sample server does that for anything other than IllegalArgumentException. Spring Boot registers GrpcExceptionHandlerInterceptor as a global interceptor even when there are no handler beans, so a thrown status goes through FallbackHandler.

FallbackHandler returns Status.fromThrowable(exception).asException(), which keeps the code and description and has no trailers. Up to 0.8 the interceptor closed the call with the thrown exception's trailers (71355e6f). The fixes for gh-193 and gh-332 switched to the trailers of the handler result, so the thrown trailers are lost when the handler returns null.

Lingua principale
Java
Stelle
415
Fork
104
Merge medio
5g 15h
PR unite (30g)
2

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di spring-projects/spring-grpc

Tutte le issue di spring-projects/spring-grpc

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.