lorinlee commented on issue #2033: URL: https://github.com/apache/incubator-brpc/issues/2033#issuecomment-1336358412
这个原因是thrift和baidu_std对异常的处理方式不同。baidu_std在框架侧没有捕获异常,thrift捕获了异常并且设置了cntl。 thrift这样的实现,在调用用户callback时,如果catch到了异常,是需要保证cntl还有效的,因为需要将错误设置到cntl。而done->Run()如果将rpc返回了,那相应的,cntl、request、response这些也都会释放,所以目前是需要等callback结束,才会rpc返回。 这里建议是将rpc返回之后的工作放到其他线程或者bthread做。如果一定要放在callback里的话,靠hack也可以实现,但这样会依赖thrift协议本身实现的内部逻辑,不太建议,可以看下ProcessThriftFramedRequestNoExcept函数的逻辑 -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
