You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "NavidJalali (via GitHub)" <gi...@apache.org> on 2025/06/24 13:24:34 UTC
[PR] add trailer attribute to trailer only optimized response [pekko-grpc]
NavidJalali opened a new pull request, #471:
URL: https://github.com/apache/pekko-grpc/pull/471
Trailer attribute is set by `GrpcProtocolWriter` in the success path but in the failure path it is missing
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] add trailer attribute to trailer only optimized response [pekko-grpc]
Posted by "NavidJalali (via GitHub)" <gi...@apache.org>.
NavidJalali commented on code in PR #471:
URL: https://github.com/apache/pekko-grpc/pull/471#discussion_r2164078250
##########
runtime/src/main/scala/org/apache/pekko/grpc/internal/GrpcResponseHelpers.scala:
##########
@@ -111,6 +111,6 @@ object GrpcResponseHelpers {
headers.`Message-Encoding`(writer.messageEncoding.name) ::
GrpcEntityHelpers.trailers(trailer.status, trailer.metadata),
entity = HttpEntity.empty(writer.contentType)
- )
+ ).withAttributes(Map(AttributeKeys.trailer -> trailer))
Review Comment:
Can you point me to the place where this translation from trailer attribute to headers happens?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] add trailer attribute to trailer only optimized response [pekko-grpc]
Posted by "NavidJalali (via GitHub)" <gi...@apache.org>.
NavidJalali commented on code in PR #471:
URL: https://github.com/apache/pekko-grpc/pull/471#discussion_r2164061335
##########
runtime/src/main/scala/org/apache/pekko/grpc/internal/GrpcResponseHelpers.scala:
##########
@@ -111,6 +111,6 @@ object GrpcResponseHelpers {
headers.`Message-Encoding`(writer.messageEncoding.name) ::
GrpcEntityHelpers.trailers(trailer.status, trailer.metadata),
entity = HttpEntity.empty(writer.contentType)
- )
+ ).withAttributes(Map(AttributeKeys.trailer -> trailer))
Review Comment:
Wouldn't it be preferable to then only add it to the attributes and rely on it getting added later on?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] add trailer attribute to trailer only optimized response [pekko-grpc]
Posted by "raboof (via GitHub)" <gi...@apache.org>.
raboof commented on code in PR #471:
URL: https://github.com/apache/pekko-grpc/pull/471#discussion_r2164019308
##########
runtime/src/main/scala/org/apache/pekko/grpc/internal/GrpcResponseHelpers.scala:
##########
@@ -111,6 +111,6 @@ object GrpcResponseHelpers {
headers.`Message-Encoding`(writer.messageEncoding.name) ::
GrpcEntityHelpers.trailers(trailer.status, trailer.metadata),
entity = HttpEntity.empty(writer.contentType)
- )
+ ).withAttributes(Map(AttributeKeys.trailer -> trailer))
Review Comment:
if the trailer headers are already written to the `headers`, are they still needed as `attribute`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] add trailer attribute to trailer only optimized response [pekko-grpc]
Posted by "NavidJalali (via GitHub)" <gi...@apache.org>.
NavidJalali commented on code in PR #471:
URL: https://github.com/apache/pekko-grpc/pull/471#discussion_r2164025569
##########
runtime/src/main/scala/org/apache/pekko/grpc/internal/GrpcResponseHelpers.scala:
##########
@@ -111,6 +111,6 @@ object GrpcResponseHelpers {
headers.`Message-Encoding`(writer.messageEncoding.name) ::
GrpcEntityHelpers.trailers(trailer.status, trailer.metadata),
entity = HttpEntity.empty(writer.contentType)
- )
+ ).withAttributes(Map(AttributeKeys.trailer -> trailer))
Review Comment:
I think its nicer on the akka http level to have a unified way of finding the trailer regardless of the success or failure of the request, wdyt
##########
runtime/src/main/scala/org/apache/pekko/grpc/internal/GrpcResponseHelpers.scala:
##########
@@ -111,6 +111,6 @@ object GrpcResponseHelpers {
headers.`Message-Encoding`(writer.messageEncoding.name) ::
GrpcEntityHelpers.trailers(trailer.status, trailer.metadata),
entity = HttpEntity.empty(writer.contentType)
- )
+ ).withAttributes(Map(AttributeKeys.trailer -> trailer))
Review Comment:
I think its nicer on the akka http level to have a unified way of finding the trailer regardless of the success or failure of the request, wdyt?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] add trailer attribute to trailer only optimized response [pekko-grpc]
Posted by "NavidJalali (via GitHub)" <gi...@apache.org>.
NavidJalali commented on code in PR #471:
URL: https://github.com/apache/pekko-grpc/pull/471#discussion_r2164026321
##########
runtime/src/main/scala/org/apache/pekko/grpc/internal/GrpcResponseHelpers.scala:
##########
@@ -111,6 +111,6 @@ object GrpcResponseHelpers {
headers.`Message-Encoding`(writer.messageEncoding.name) ::
GrpcEntityHelpers.trailers(trailer.status, trailer.metadata),
entity = HttpEntity.empty(writer.contentType)
- )
+ ).withAttributes(Map(AttributeKeys.trailer -> trailer))
Review Comment:
For example for logging
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] add trailer attribute to trailer only optimized response [pekko-grpc]
Posted by "NavidJalali (via GitHub)" <gi...@apache.org>.
NavidJalali commented on code in PR #471:
URL: https://github.com/apache/pekko-grpc/pull/471#discussion_r2164059250
##########
runtime/src/main/scala/org/apache/pekko/grpc/internal/GrpcResponseHelpers.scala:
##########
@@ -111,6 +111,6 @@ object GrpcResponseHelpers {
headers.`Message-Encoding`(writer.messageEncoding.name) ::
GrpcEntityHelpers.trailers(trailer.status, trailer.metadata),
entity = HttpEntity.empty(writer.contentType)
- )
+ ).withAttributes(Map(AttributeKeys.trailer -> trailer))
Review Comment:
Wait is that because I manually add them to the headers myself and if a trailer attribute gets detected it will also get added somewhere further in the pipeline?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] add trailer attribute to trailer only optimized response [pekko-grpc]
Posted by "NavidJalali (via GitHub)" <gi...@apache.org>.
NavidJalali commented on PR #471:
URL: https://github.com/apache/pekko-grpc/pull/471#issuecomment-3000503579
Ah it seems I made a bit mistake 😄
There is a difference in types
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] add trailer attribute to trailer only optimized response [pekko-grpc]
Posted by "raboof (via GitHub)" <gi...@apache.org>.
raboof commented on code in PR #471:
URL: https://github.com/apache/pekko-grpc/pull/471#discussion_r2164041322
##########
runtime/src/main/scala/org/apache/pekko/grpc/internal/GrpcResponseHelpers.scala:
##########
@@ -111,6 +111,6 @@ object GrpcResponseHelpers {
headers.`Message-Encoding`(writer.messageEncoding.name) ::
GrpcEntityHelpers.trailers(trailer.status, trailer.metadata),
entity = HttpEntity.empty(writer.contentType)
- )
+ ).withAttributes(Map(AttributeKeys.trailer -> trailer))
Review Comment:
AFAICT this change would cause the status/metadata headers to be added twice: once to the regular response, and then once again as a block of trailing headers.
While I can understand the attraction of having the status information in the 'same place', I'm not sure that weights up against the optimization of having a regular set of headers rather than a split between normal and trailing headers in this case.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] add trailer attribute to trailer only optimized response [pekko-grpc]
Posted by "NavidJalali (via GitHub)" <gi...@apache.org>.
NavidJalali commented on code in PR #471:
URL: https://github.com/apache/pekko-grpc/pull/471#discussion_r2166398989
##########
runtime/src/main/scala/org/apache/pekko/grpc/internal/GrpcResponseHelpers.scala:
##########
@@ -111,6 +111,6 @@ object GrpcResponseHelpers {
headers.`Message-Encoding`(writer.messageEncoding.name) ::
GrpcEntityHelpers.trailers(trailer.status, trailer.metadata),
entity = HttpEntity.empty(writer.contentType)
- )
+ ).withAttributes(Map(AttributeKeys.trailer -> trailer))
Review Comment:
Can you point me to the place where this translation from trailer attributes to headers happens?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] add trailer attribute to trailer only optimized response [pekko-grpc]
Posted by "NavidJalali (via GitHub)" <gi...@apache.org>.
NavidJalali commented on code in PR #471:
URL: https://github.com/apache/pekko-grpc/pull/471#discussion_r2164078250
##########
runtime/src/main/scala/org/apache/pekko/grpc/internal/GrpcResponseHelpers.scala:
##########
@@ -111,6 +111,6 @@ object GrpcResponseHelpers {
headers.`Message-Encoding`(writer.messageEncoding.name) ::
GrpcEntityHelpers.trailers(trailer.status, trailer.metadata),
entity = HttpEntity.empty(writer.contentType)
- )
+ ).withAttributes(Map(AttributeKeys.trailer -> trailer))
Review Comment:
Can you point me to the place where this translation from trailer attribute to headers happens?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] add trailer attribute to trailer only optimized response [pekko-grpc]
Posted by "raboof (via GitHub)" <gi...@apache.org>.
raboof commented on code in PR #471:
URL: https://github.com/apache/pekko-grpc/pull/471#discussion_r2166490131
##########
runtime/src/main/scala/org/apache/pekko/grpc/internal/GrpcResponseHelpers.scala:
##########
@@ -111,6 +111,6 @@ object GrpcResponseHelpers {
headers.`Message-Encoding`(writer.messageEncoding.name) ::
GrpcEntityHelpers.trailers(trailer.status, trailer.metadata),
entity = HttpEntity.empty(writer.contentType)
- )
+ ).withAttributes(Map(AttributeKeys.trailer -> trailer))
Review Comment:
https://github.com/apache/pekko-http/blob/main/http-core/src/main/scala/org/apache/pekko/http/impl/engine/http2/HttpMessageRendering.scala#L98-L106
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] add trailer attribute to trailer only optimized response [pekko-grpc]
Posted by "raboof (via GitHub)" <gi...@apache.org>.
raboof commented on code in PR #471:
URL: https://github.com/apache/pekko-grpc/pull/471#discussion_r2164087720
##########
runtime/src/main/scala/org/apache/pekko/grpc/internal/GrpcResponseHelpers.scala:
##########
@@ -111,6 +111,6 @@ object GrpcResponseHelpers {
headers.`Message-Encoding`(writer.messageEncoding.name) ::
GrpcEntityHelpers.trailers(trailer.status, trailer.metadata),
entity = HttpEntity.empty(writer.contentType)
- )
+ ).withAttributes(Map(AttributeKeys.trailer -> trailer))
Review Comment:
> Wait is that because I manually add them to the headers myself and if a trailer attribute gets detected it will also get added somewhere further in the pipeline?
Exactly: the headers go into the headers fragment of the response, and the trailer attribute goes into the trailing headers fragment of the response.
> Wouldn't it be preferable to then only add it to the attributes and rely on it getting added later on?
that would still split it over a headers fragment and a trailing headers block. I think it's ok to send a single headers fragment in this case, even if it means putting the 'trailer' data into regular headers - this is basically the `Trailers-Only` scenario.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] add trailer attribute to trailer only optimized response [pekko-grpc]
Posted by "NavidJalali (via GitHub)" <gi...@apache.org>.
NavidJalali closed pull request #471: add trailer attribute to trailer only optimized response
URL: https://github.com/apache/pekko-grpc/pull/471
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org