You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2022/05/13 04:49:13 UTC

[GitHub] [incubator-brpc] amosbird opened a new issue, #1761: What's the behavior of SendRpcResponse in memory constrained env?

amosbird opened a new issue, #1761:
URL: https://github.com/apache/incubator-brpc/issues/1761

   It seems `SendRpcResponse` contains heap allocations (`butil::IOBuf::append`) which returns `-1` if malloc fails. This error code is silently dropped when building response. Do we have defined behavior when response is partially built and sent back to client?
   
   ref:
   
   https://github.com/apache/incubator-brpc/blob/master/src/brpc/policy/baidu_rpc_protocol.cpp#L222-L229
   
   btw, can we mark `SendRpcResponse` as **noexcept** ?


-- 
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: dev-unsubscribe@brpc.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] wwbmmm commented on issue #1761: What's the behavior of SendRpcResponse in memory constrained env?

Posted by GitBox <gi...@apache.org>.
wwbmmm commented on issue #1761:
URL: https://github.com/apache/incubator-brpc/issues/1761#issuecomment-1125692488

   > @wwbmmm Thank you for the quick response. I was referring to these two `append` calls. https://github.com/apache/incubator-brpc/blob/master/src/brpc/policy/baidu_rpc_protocol.cpp#L83-L87
   
   It is better to check return code for these two `append` calls. But in practice, we rarely encounter `append` failures.


-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] wwbmmm commented on issue #1761: What's the behavior of SendRpcResponse in memory constrained env?

Posted by GitBox <gi...@apache.org>.
wwbmmm commented on issue #1761:
URL: https://github.com/apache/incubator-brpc/issues/1761#issuecomment-1125665605

   The append function is void, it will not return -1: 
   `void append(const Movable& other);`
   https://github.com/apache/incubator-brpc/blob/master/src/butil/iobuf.h#L206


-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] zyearn closed issue #1761: What's the behavior of SendRpcResponse in memory constrained env?

Posted by GitBox <gi...@apache.org>.
zyearn closed issue #1761: What's the behavior of SendRpcResponse in memory constrained env?
URL: https://github.com/apache/incubator-brpc/issues/1761


-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] amosbird commented on issue #1761: What's the behavior of SendRpcResponse in memory constrained env?

Posted by GitBox <gi...@apache.org>.
amosbird commented on issue #1761:
URL: https://github.com/apache/incubator-brpc/issues/1761#issuecomment-1125688479

   @wwbmmm Thank you for the quick response. I was referring to this `append` https://github.com/apache/incubator-brpc/blob/master/src/brpc/policy/baidu_rpc_protocol.cpp#L83 .


-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] amosbird commented on issue #1761: What's the behavior of SendRpcResponse in memory constrained env?

Posted by GitBox <gi...@apache.org>.
amosbird commented on issue #1761:
URL: https://github.com/apache/incubator-brpc/issues/1761#issuecomment-1125695013

   > It is better to check return code for these two append calls.
   
   I guess the answer is UB then :)
   
   > But in practice, we rarely encounter append failures.
   
   Memory allocation failures are always rare. However, well-defined applications are required to handle it properly. This is especially true since brpc identifies itself as an industrial-grade RPC framework.


-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org